forked from 0x2620/pandora
make showAnnotations sticky
This commit is contained in:
parent
6aa8f23ce2
commit
5f3a554183
2 changed files with 19 additions and 8 deletions
|
@ -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});
|
||||
}
|
||||
}),
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue