add annotation event from annotation panel
This commit is contained in:
parent
fedd0c7e80
commit
fe9b0618ed
4 changed files with 72 additions and 24 deletions
|
|
@ -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;
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue