From 529184887a73ffc30c6f648c45dd2b031c9ebf7e Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sun, 19 Feb 2012 11:06:03 +0000 Subject: [PATCH] make doubleclicking on non-editable annotation 'open' it, i.e. go to its in point --- source/Ox.UI/js/Form/Ox.ArrayEditable.js | 9 +++++++-- source/Ox.UI/js/Form/Ox.Editable.js | 2 ++ source/Ox.UI/js/Video/Ox.AnnotationFolder.js | 3 +++ source/Ox.UI/js/Video/Ox.AnnotationPanel.js | 3 +++ source/Ox.UI/js/Video/Ox.VideoEditor.js | 3 +++ source/Ox.UI/js/Video/Ox.VideoPanel.js | 3 +++ 6 files changed, 21 insertions(+), 2 deletions(-) diff --git a/source/Ox.UI/js/Form/Ox.ArrayEditable.js b/source/Ox.UI/js/Form/Ox.ArrayEditable.js index 0a221257..f44b8545 100644 --- a/source/Ox.UI/js/Form/Ox.ArrayEditable.js +++ b/source/Ox.UI/js/Form/Ox.ArrayEditable.js @@ -161,16 +161,19 @@ Ox.ArrayEditable = function(options, self) { value: data.value }); }, - edit: function(data) { + edit: function() { if (item.id != self.options.selected) { selectItem(item.id); } self.editing = true; - that.triggerEvent('edit', data); + that.triggerEvent('edit'); }, insert: function(data) { that.triggerEvent('insert', data); }, + open: function(data) { + that.triggerEvent('open'); + }, submit: function(data) { self.editing = false; that.gainFocus(); @@ -362,6 +365,8 @@ Ox.ArrayEditable = function(options, self) { if (self.options.editable && self.options.selected) { self.editing = true; self.$items[self.selected].options({editing: true}); + } else if (!self.options.editable) { + that.triggerEvent('open'); } return that; }; diff --git a/source/Ox.UI/js/Form/Ox.Editable.js b/source/Ox.UI/js/Form/Ox.Editable.js index 6858d36a..f36430d7 100644 --- a/source/Ox.UI/js/Form/Ox.Editable.js +++ b/source/Ox.UI/js/Form/Ox.Editable.js @@ -149,6 +149,8 @@ Ox.Editable = function(options, self) { that.$tooltip && that.$tooltip.options({title: ''}); that.triggerEvent('edit'); } + } else if (!self.options.editable) { + that.triggerEvent('open'); } self.options.blurred = false; } diff --git a/source/Ox.UI/js/Video/Ox.AnnotationFolder.js b/source/Ox.UI/js/Video/Ox.AnnotationFolder.js index 6c826224..f15fd5d4 100644 --- a/source/Ox.UI/js/Video/Ox.AnnotationFolder.js +++ b/source/Ox.UI/js/Video/Ox.AnnotationFolder.js @@ -233,6 +233,9 @@ Ox.AnnotationFolder = function(options, self) { insert: function(data) { that.triggerEvent('insert', data); }, + open: function() { + that.triggerEvent('open'); + }, select: selectAnnotation, selectafter: function() { that.triggerEvent('selectafter'); diff --git a/source/Ox.UI/js/Video/Ox.AnnotationPanel.js b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js index 0e24abcc..c3e5e2b7 100644 --- a/source/Ox.UI/js/Video/Ox.AnnotationPanel.js +++ b/source/Ox.UI/js/Video/Ox.AnnotationPanel.js @@ -88,6 +88,9 @@ Ox.AnnotationPanel = function(options, self) { that.triggerEvent('info', {layer: layer.id}); }, insert: insert, + open: function() { + that.triggerEvent('open'); + }, remove: function(data) { that.triggerEvent('remove', Ox.extend({layer: layer.id}, data)); }, diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index 7e7b6f9a..493ac5ba 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -648,6 +648,9 @@ Ox.VideoEditor = function(options, self) { info: function(data) { that.triggerEvent('info', data); }, + open: function() { + setPosition(self.options['in']); + }, remove: removeAnnotation, resize: resizeAnnotations, resizeend: resizeendAnnotations, diff --git a/source/Ox.UI/js/Video/Ox.VideoPanel.js b/source/Ox.UI/js/Video/Ox.VideoPanel.js index ce8d73e2..8912f457 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPanel.js +++ b/source/Ox.UI/js/Video/Ox.VideoPanel.js @@ -209,6 +209,9 @@ Ox.VideoPanel = function(options, self) { self.options.annotationsSort = data.sort; that.triggerEvent('annotationssort', data); }, + open: function() { + setPosition(self.options['in']); + }, resize: resizeAnnotations, resizeend: resizeendAnnotations, resizecalendar: function(data) {