add Add note placeholder

This commit is contained in:
j 2019-01-31 23:02:17 +05:30
parent b4c4372394
commit 8bb7503675

View file

@ -14,21 +14,28 @@ oml.ui.annotation = function(annotation, $iframe) {
var notes = annotation.notes.length ? annotation.notes.map(function(note) { var notes = annotation.notes.length ? annotation.notes.map(function(note) {
note.editable = !note.user note.editable = !note.user
return note return note
}) : [{ }) : []
id: 'A',
placeholder: 'Add Note',
value: '',
editable: true
}];
console.log(annotation.notes) console.log(annotation.notes)
var $note = Ox.ArrayEditable({ var $notes = Ox.ArrayEditable({
editing: true, editing: true,
items: notes, items: notes,
placeholder: 'Add note',
type: 'textarea' type: 'textarea'
}).css({ }).css({
margin: '2px', margin: '2px',
minHeight: '12px' minHeight: '12px'
}).bindEvent({ }).bindEvent({
doubleclick: function(data) {
if (!$notes.options('items').length) {
$notes.addItem(0, {
id: 'A',
value: '',
editable: true
}).options({
selected: 'A'
}).editItem()
}
},
submit: function(data) { submit: function(data) {
var note = Ox.getObjectById(annotation.notes, data.id) var note = Ox.getObjectById(annotation.notes, data.id)
if (note) { if (note) {
@ -58,7 +65,7 @@ oml.ui.annotation = function(annotation, $iframe) {
id: annotation.id id: annotation.id
}) })
} }
}).append($quote).append($note); }).append($quote).append($notes);
that.annotate = function() { that.annotate = function() {
var item = { var item = {