bind events

This commit is contained in:
j 2019-01-24 17:23:43 +05:30
parent b509d8f436
commit ebab25c47d

View file

@ -2,9 +2,13 @@ let txtjs = {}
Ox.load({UI: {loadCSS: false}}, function() { Ox.load({UI: {loadCSS: false}}, function() {
Ox.$parent.bindMessage(function(data, event) { Ox.$parent.bindMessage(function(data, event) {
console.log(event, data)
if (event == 'selectAnnotation') { if (event == 'selectAnnotation') {
txtjs.selectNote(data.id)
} else if (event == 'addAnnotations') {
data.annotations.forEach(function(note) {
txtjs.renderNote(note)
txtjs.notes.push(note)
})
} }
}) })
}) })