VideoPreview: accept tooltip function
This commit is contained in:
parent
61ca7657b1
commit
c567a80a44
1 changed files with 4 additions and 6 deletions
|
@ -69,18 +69,16 @@ Ox.VideoPreview = function(options, self) {
|
||||||
self.$interface = Ox.Element({
|
self.$interface = Ox.Element({
|
||||||
tooltip: function(event) {
|
tooltip: function(event) {
|
||||||
// e.offsetX does not work in Firefox
|
// e.offsetX does not work in Firefox
|
||||||
var position = getPosition(event.clientX - that.offset().left);
|
var position = getPosition(event.clientX - that.offset().left),
|
||||||
|
tooltip = Ox.isFunction(self.options.tooltip)
|
||||||
|
? self.options.tooltip() : self.options.tooltip;
|
||||||
self.$frame.attr({src: getClosestFrame(position)});
|
self.$frame.attr({src: getClosestFrame(position)});
|
||||||
self.timeout && clearTimeout(self.timeout);
|
self.timeout && clearTimeout(self.timeout);
|
||||||
self.timeout = setTimeout(function() {
|
self.timeout = setTimeout(function() {
|
||||||
self.$frame.attr({src: self.options.getFrame(position)});
|
self.$frame.attr({src: self.options.getFrame(position)});
|
||||||
}, 250);
|
}, 250);
|
||||||
return '<div style="text-align: center>"'
|
return '<div style="text-align: center>"'
|
||||||
+ (self.options.tooltip ? (
|
+ (tooltip ? tooltip + '<br>' : '')
|
||||||
Ox.isFunction(self.options.tooltip)
|
|
||||||
? self.options.tooltip()
|
|
||||||
: self.options.tooltip
|
|
||||||
) + '<br>' : '')
|
|
||||||
+ Ox.formatDuration(position, 2)
|
+ Ox.formatDuration(position, 2)
|
||||||
+ '</div>';
|
+ '</div>';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue