diff --git a/static/js/pandora/ui/editor.js b/static/js/pandora/ui/editor.js index eb34f88..28b05e3 100644 --- a/static/js/pandora/ui/editor.js +++ b/static/js/pandora/ui/editor.js @@ -1,16 +1,21 @@ // vim: et:ts=4:sw=4:sts=4:ft=javascript + +// fixme: this should be deleted!! + pandora.ui.annotations = function() { var that = Ox.Element({ id: 'annotations' }) .bindEvent({ - resize: function(event, data) { + resize: function(data) { pandora.user.ui.annotationsSize = data; }, - resizeend: function(event, data) { + resizeend: function(data) { + //alert('resizeend', JSON.stringify(data)) pandora.UI.set({annotationsSize: data}); }, - toggle: function(event, data) { + toggle: function(data) { + //alert('toggle', JSON.stringify(data)) pandora.UI.set({showAnnotations: !data.collapsed}); } }), diff --git a/static/js/pandora/ui/item.js b/static/js/pandora/ui/item.js index b22907b..52cd70f 100644 --- a/static/js/pandora/ui/item.js +++ b/static/js/pandora/ui/item.js @@ -308,15 +308,18 @@ pandora.ui.item = function() { video: streams, width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1 }).bindEvent({ - resize: function(event, data) { + resize: function(data) { pandora.$ui.editor.options({ height: data }); }, - togglesize: function(event, data) { + resizeend: function(data) { + pandora.UI.set({annotationsSize: data}); + }, + togglesize: function(data) { pandora.UI.set({videoSize: data.size}); }, - addAnnotation: function(event, data) { + addAnnotation: function(data) { Ox.print('addAnnotation', data); data.item = pandora.user.ui.item; data.value = 'Click to edit'; @@ -324,13 +327,16 @@ pandora.ui.item = function() { pandora.$ui.editor.addAnnotation(data.layer, result.data); }); }, - removeAnnotations: function(event, data) { + removeAnnotations: function(data) { pandora.api.removeAnnotations(data, function(result) { //fixme: check for errors pandora.$ui.editor.removeAnnotations(data.layer, data.ids); }); }, - updateAnnotation: function(event, data) { + toggleAnnotations: function(data) { + pandora.UI.set('showAnnotations', data.visible); + }, + updateAnnotation: function(data) { //fixme: check that edit was successfull pandora.api.editAnnotation(data, function(result) { Ox.print('done updateAnnotation', result);