add annotation event from annotation panel

This commit is contained in:
j 2019-02-01 01:02:55 +05:30
commit fe9b0618ed
4 changed files with 72 additions and 24 deletions

View file

@ -10,6 +10,10 @@ oml.ui.annotationPanel = function() {
title: 'add',
tooltip: Ox._('Add Quote'),
type: 'image'
}).bindEvent({
click: function() {
oml.$ui.viewer.postMessage('addAnnotation', {})
}
}).appendTo($bar);
var $menuButton = Ox.MenuButton({
@ -50,6 +54,12 @@ oml.ui.annotationPanel = function() {
orientation: 'vertical'
});
that.updateSelection = function(selection) {
$button.options({
disabled: !selection
})
}
return that;
};

View file

@ -110,6 +110,8 @@ oml.ui.viewer = function() {
} else if (event == 'deselectAnnotation') {
var $annotation = oml.$ui.annotationFolder.find('#a-' + data.id)[0]
$annotation && $annotation.deselect()
} else if (event == 'selection') {
oml.$ui.annotationPanel.updateSelection(data)
} else {
console.log('got', event, data)
that.triggerEvent(event, data);