diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index ceab5959..553a3e5e 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -494,7 +494,7 @@ Ox.VideoEditor = function(options, self) { .appendTo(self.$videobar); self.$clearButton = Ox.Button({ - disabled: true, + disabled: self.options.find === '', style: 'symbol', title: 'close', tooltip: 'Clear', @@ -657,6 +657,12 @@ Ox.VideoEditor = function(options, self) { orientation: 'horizontal' }); + // we need a timeout so that a chained bindEvent + // actually catches the event + self.options.find && setTimeout(function() { + submitFindInput(self.options.find, true); + }, 0); + function changePlayer(data) { self.options.position = data.position; self.$timeline[0].options({ @@ -837,23 +843,14 @@ Ox.VideoEditor = function(options, self) { function goToPoint(point) { setPosition(self.options[point]); - that.triggerEvent('position', { - position: self.options.position - }); } function movePositionBy(sec) { setPosition(Ox.limit(self.options.position + sec, 0, self.options.duration)); - that.triggerEvent('position', { - position: self.options.position - }); } function movePositionTo(type, direction) { setPosition(getNextPosition(type, direction)); - that.triggerEvent('position', { - position: self.options.position - }); } function playInToOut() { @@ -936,6 +933,9 @@ Ox.VideoEditor = function(options, self) { position: self.options.position }); }); + that.triggerEvent('position', { + position: self.options.position + }); } function setSizes() { @@ -985,10 +985,12 @@ Ox.VideoEditor = function(options, self) { opacity: self.results.length ? 1 : 0.25 }); if (hasPressedEnter) { - self.results.length ? - setPosition(getNextPosition('result', 1)) : - self.$findInput.focusInput(); that.triggerEvent('find', {find: self.options.find}); + if (self.results.length) { + setPosition(getNextPosition('result', 1)); + } else { + self.$findInput.focusInput(); + } } }