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 // -------- Description
if (data.description) { if (data.description || isEditable) {
$('<div>') $('<div>')
.css({ .css({
marginTop: '8px', marginTop: '8px',
textAlign: 'justify' 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( .bindEvent({
Ox.encodeHTMLEntities(data.description) submit: function(event) {
) editMetadata(key, event.value);
.appendTo($info); }
})
).appendTo($info);
} }
$('<div>').css({height: '16px'}).appendTo($info); $('<div>').css({height: '16px'}).appendTo($info);