update annotation layout

This commit is contained in:
rlx 2019-01-24 12:52:40 +05:30
commit 1206f0c41e
4 changed files with 50 additions and 19 deletions

View file

@ -25,6 +25,8 @@ oml.ui.viewer = function() {
collapsed: !ui.showAnnotations,
collapsible: true,
element: oml.$ui.annotationPanel = oml.ui.annotationPanel(),
resizable: true,
resize: [128, 384],
size: 256,
tooltip: Ox._('Annotations')
+ ' <span class="OxBright">'
@ -41,7 +43,7 @@ oml.ui.viewer = function() {
if (item && item.length) {
oml.api.get({id: item, keys: ['mediastate']}, function(result) {
if (result.data.mediastate == 'available') {
oml.$ui.annotationPanel.empty()
oml.$ui.annotationFolder.empty()
if ($iframe) {
$iframe.remove()
}
@ -53,10 +55,10 @@ oml.ui.viewer = function() {
console.log('got', event, data)
if (event == 'addAnnotation') {
console.log('adding', data.id)
oml.$ui.annotationPanel.append(oml.ui.annotation(data, $iframe));
oml.$ui.annotationFolder.append(oml.ui.annotation(data, $iframe));
} else if (event == 'removeAnnotation') {
console.log('do it ...', data)
oml.$ui.annotationPanel.find('#a-' + data.id).remove()
oml.$ui.annotationFolder.find('#a-' + data.id).remove()
} else if (event == 'selectAnnotation') {
console.log('select', data)
} else if (event == 'deselectAnnotation') {