make description editable

This commit is contained in:
j 2015-11-30 17:59:23 +01:00
parent 216cb411fe
commit 2ea25949ed
1 changed files with 19 additions and 6 deletions

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