enter to add annotation

This commit is contained in:
j 2019-02-01 00:12:52 +05:30
commit fedd0c7e80
4 changed files with 68 additions and 20 deletions

View file

@ -95,7 +95,6 @@ oml.ui.viewer = function() {
height: '100%',
border: 0
}).onMessage(function(data, event) {
console.log('got', event, data)
if (event == 'addAnnotation') {
console.log('adding', data.id)
saveAnnotations(data);
@ -107,11 +106,12 @@ oml.ui.viewer = function() {
removeAnnotation(data.id)
} else if (event == 'selectAnnotation') {
var $annotation = oml.$ui.annotationFolder.find('#a-' + data.id)
$annotation.select()
$annotation && $annotation.select()
} else if (event == 'deselectAnnotation') {
var $annotation = oml.$ui.annotationFolder.find('#a-' + data.id)
$annotation.deselect()
var $annotation = oml.$ui.annotationFolder.find('#a-' + data.id)[0]
$annotation && $annotation.deselect()
} else {
console.log('got', event, data)
that.triggerEvent(event, data);
}