bind events

This commit is contained in:
j 2019-01-24 17:23:43 +05:30
parent b509d8f436
commit ebab25c47d
1 changed files with 6 additions and 2 deletions

View File

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