improved handling of find in video editor
This commit is contained in:
parent
462b335416
commit
aca33124d0
1 changed files with 15 additions and 13 deletions
|
@ -494,7 +494,7 @@ Ox.VideoEditor = function(options, self) {
|
||||||
.appendTo(self.$videobar);
|
.appendTo(self.$videobar);
|
||||||
|
|
||||||
self.$clearButton = Ox.Button({
|
self.$clearButton = Ox.Button({
|
||||||
disabled: true,
|
disabled: self.options.find === '',
|
||||||
style: 'symbol',
|
style: 'symbol',
|
||||||
title: 'close',
|
title: 'close',
|
||||||
tooltip: 'Clear',
|
tooltip: 'Clear',
|
||||||
|
@ -657,6 +657,12 @@ Ox.VideoEditor = function(options, self) {
|
||||||
orientation: 'horizontal'
|
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) {
|
function changePlayer(data) {
|
||||||
self.options.position = data.position;
|
self.options.position = data.position;
|
||||||
self.$timeline[0].options({
|
self.$timeline[0].options({
|
||||||
|
@ -837,23 +843,14 @@ Ox.VideoEditor = function(options, self) {
|
||||||
|
|
||||||
function goToPoint(point) {
|
function goToPoint(point) {
|
||||||
setPosition(self.options[point]);
|
setPosition(self.options[point]);
|
||||||
that.triggerEvent('position', {
|
|
||||||
position: self.options.position
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function movePositionBy(sec) {
|
function movePositionBy(sec) {
|
||||||
setPosition(Ox.limit(self.options.position + sec, 0, self.options.duration));
|
setPosition(Ox.limit(self.options.position + sec, 0, self.options.duration));
|
||||||
that.triggerEvent('position', {
|
|
||||||
position: self.options.position
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function movePositionTo(type, direction) {
|
function movePositionTo(type, direction) {
|
||||||
setPosition(getNextPosition(type, direction));
|
setPosition(getNextPosition(type, direction));
|
||||||
that.triggerEvent('position', {
|
|
||||||
position: self.options.position
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function playInToOut() {
|
function playInToOut() {
|
||||||
|
@ -936,6 +933,9 @@ Ox.VideoEditor = function(options, self) {
|
||||||
position: self.options.position
|
position: self.options.position
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
that.triggerEvent('position', {
|
||||||
|
position: self.options.position
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setSizes() {
|
function setSizes() {
|
||||||
|
@ -985,10 +985,12 @@ Ox.VideoEditor = function(options, self) {
|
||||||
opacity: self.results.length ? 1 : 0.25
|
opacity: self.results.length ? 1 : 0.25
|
||||||
});
|
});
|
||||||
if (hasPressedEnter) {
|
if (hasPressedEnter) {
|
||||||
self.results.length ?
|
|
||||||
setPosition(getNextPosition('result', 1)) :
|
|
||||||
self.$findInput.focusInput();
|
|
||||||
that.triggerEvent('find', {find: self.options.find});
|
that.triggerEvent('find', {find: self.options.find});
|
||||||
|
if (self.results.length) {
|
||||||
|
setPosition(getNextPosition('result', 1));
|
||||||
|
} else {
|
||||||
|
self.$findInput.focusInput();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue