From 99f9af5cd25438022663b632f4e035cdfc096858 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Wed, 15 Feb 2012 13:16:03 +0000 Subject: [PATCH] check for presence of annotations before acting on keyboard input --- source/Ox.UI/js/Video/Ox.VideoEditor.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index e205b841..cd130546 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -74,10 +74,10 @@ Ox.VideoEditor = function(options, self) { key_alt_shift_right: function() { }, key_b: function() { - selectAnnotation(getNextAnnotation('annotation', -1)); + self.annotations.length && selectAnnotation(getNextAnnotation('annotation', -1)); }, key_backslash: function() { - selectAnnotation(); + self.annotations.length && selectAnnotation(); }, key_closebracket: function() { self.annotations.length && movePositionTo('annotation', 1); @@ -128,7 +128,7 @@ Ox.VideoEditor = function(options, self) { self.options.videoSize == 'large' && toggleSize(); }, key_n: function() { - selectAnnotation(getNextAnnotation('annotation', 1), true); + self.annotations.length && selectAnnotation(getNextAnnotation('annotation', 1), true); }, key_o: function() { setPoint('out', self.options.position); @@ -143,12 +143,6 @@ Ox.VideoEditor = function(options, self) { key_s: function() { // toggleSize }, - key_shift_comma: function() { - movePositionTo('match', -1); - }, - key_shift_dot: function() { - movePositionTo('match', 1); - }, key_shift_down: function() { movePositionBy(self.options.duration); },