make doubleclicking on non-editable annotation 'open' it, i.e. go to its in point

This commit is contained in:
rlx 2012-02-19 11:06:03 +00:00
parent 94cfbdb45c
commit 529184887a
6 changed files with 21 additions and 2 deletions

View file

@ -161,16 +161,19 @@ Ox.ArrayEditable = function(options, self) {
value: data.value value: data.value
}); });
}, },
edit: function(data) { edit: function() {
if (item.id != self.options.selected) { if (item.id != self.options.selected) {
selectItem(item.id); selectItem(item.id);
} }
self.editing = true; self.editing = true;
that.triggerEvent('edit', data); that.triggerEvent('edit');
}, },
insert: function(data) { insert: function(data) {
that.triggerEvent('insert', data); that.triggerEvent('insert', data);
}, },
open: function(data) {
that.triggerEvent('open');
},
submit: function(data) { submit: function(data) {
self.editing = false; self.editing = false;
that.gainFocus(); that.gainFocus();
@ -362,6 +365,8 @@ Ox.ArrayEditable = function(options, self) {
if (self.options.editable && self.options.selected) { if (self.options.editable && self.options.selected) {
self.editing = true; self.editing = true;
self.$items[self.selected].options({editing: true}); self.$items[self.selected].options({editing: true});
} else if (!self.options.editable) {
that.triggerEvent('open');
} }
return that; return that;
}; };

View file

@ -149,6 +149,8 @@ Ox.Editable = function(options, self) {
that.$tooltip && that.$tooltip.options({title: ''}); that.$tooltip && that.$tooltip.options({title: ''});
that.triggerEvent('edit'); that.triggerEvent('edit');
} }
} else if (!self.options.editable) {
that.triggerEvent('open');
} }
self.options.blurred = false; self.options.blurred = false;
} }

View file

@ -233,6 +233,9 @@ Ox.AnnotationFolder = function(options, self) {
insert: function(data) { insert: function(data) {
that.triggerEvent('insert', data); that.triggerEvent('insert', data);
}, },
open: function() {
that.triggerEvent('open');
},
select: selectAnnotation, select: selectAnnotation,
selectafter: function() { selectafter: function() {
that.triggerEvent('selectafter'); that.triggerEvent('selectafter');

View file

@ -88,6 +88,9 @@ Ox.AnnotationPanel = function(options, self) {
that.triggerEvent('info', {layer: layer.id}); that.triggerEvent('info', {layer: layer.id});
}, },
insert: insert, insert: insert,
open: function() {
that.triggerEvent('open');
},
remove: function(data) { remove: function(data) {
that.triggerEvent('remove', Ox.extend({layer: layer.id}, data)); that.triggerEvent('remove', Ox.extend({layer: layer.id}, data));
}, },

View file

@ -648,6 +648,9 @@ Ox.VideoEditor = function(options, self) {
info: function(data) { info: function(data) {
that.triggerEvent('info', data); that.triggerEvent('info', data);
}, },
open: function() {
setPosition(self.options['in']);
},
remove: removeAnnotation, remove: removeAnnotation,
resize: resizeAnnotations, resize: resizeAnnotations,
resizeend: resizeendAnnotations, resizeend: resizeendAnnotations,

View file

@ -209,6 +209,9 @@ Ox.VideoPanel = function(options, self) {
self.options.annotationsSort = data.sort; self.options.annotationsSort = data.sort;
that.triggerEvent('annotationssort', data); that.triggerEvent('annotationssort', data);
}, },
open: function() {
setPosition(self.options['in']);
},
resize: resizeAnnotations, resize: resizeAnnotations,
resizeend: resizeendAnnotations, resizeend: resizeendAnnotations,
resizecalendar: function(data) { resizecalendar: function(data) {