add Add note placeholder
This commit is contained in:
parent
b4c4372394
commit
8bb7503675
1 changed files with 15 additions and 8 deletions
|
@ -14,21 +14,28 @@ oml.ui.annotation = function(annotation, $iframe) {
|
|||
var notes = annotation.notes.length ? annotation.notes.map(function(note) {
|
||||
note.editable = !note.user
|
||||
return note
|
||||
}) : [{
|
||||
id: 'A',
|
||||
placeholder: 'Add Note',
|
||||
value: '',
|
||||
editable: true
|
||||
}];
|
||||
}) : []
|
||||
console.log(annotation.notes)
|
||||
var $note = Ox.ArrayEditable({
|
||||
var $notes = Ox.ArrayEditable({
|
||||
editing: true,
|
||||
items: notes,
|
||||
placeholder: 'Add note',
|
||||
type: 'textarea'
|
||||
}).css({
|
||||
margin: '2px',
|
||||
minHeight: '12px'
|
||||
}).bindEvent({
|
||||
doubleclick: function(data) {
|
||||
if (!$notes.options('items').length) {
|
||||
$notes.addItem(0, {
|
||||
id: 'A',
|
||||
value: '',
|
||||
editable: true
|
||||
}).options({
|
||||
selected: 'A'
|
||||
}).editItem()
|
||||
}
|
||||
},
|
||||
submit: function(data) {
|
||||
var note = Ox.getObjectById(annotation.notes, data.id)
|
||||
if (note) {
|
||||
|
@ -58,7 +65,7 @@ oml.ui.annotation = function(annotation, $iframe) {
|
|||
id: annotation.id
|
||||
})
|
||||
}
|
||||
}).append($quote).append($note);
|
||||
}).append($quote).append($notes);
|
||||
|
||||
that.annotate = function() {
|
||||
var item = {
|
||||
|
|
Loading…
Reference in a new issue