make description editable

This commit is contained in:
j 2015-11-30 17:59:23 +01:00
parent 216cb411fe
commit 2ea25949ed

View file

@ -599,16 +599,29 @@ oml.ui.infoView = function(identifyData) {
// -------- Description
if (data.description) {
if (data.description || isEditable) {
$('<div>')
.css({
marginTop: '8px',
textAlign: 'justify'
}).append(
Ox.EditableContent({
clickLink: oml.clickLink,
editable: isEditable,
format: function(value) {
return Ox.encodeHTMLEntities(value);
},
placeholder: formatLight('No Description'),
tooltip: isEditable ? oml.getEditTooltip() : '',
type: 'textarea',
value: data.description || ''
})
.html(
Ox.encodeHTMLEntities(data.description)
)
.appendTo($info);
.bindEvent({
submit: function(event) {
editMetadata(key, event.value);
}
})
).appendTo($info);
}
$('<div>').css({height: '16px'}).appendTo($info);