From 5f3a554183b8564cf3ec89cef0513e9e500e8093 Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 17 Aug 2011 15:20:43 +0000 Subject: [PATCH] make showAnnotations sticky --- static/js/pandora/ui/editor.js | 11 ++++++++--- static/js/pandora/ui/item.js | 16 +++++++++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/static/js/pandora/ui/editor.js b/static/js/pandora/ui/editor.js index eb34f886..28b05e34 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 b22907bb..52cd70fd 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);