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({
|
||||
tooltip: function(event) {
|
||||
// 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.timeout && clearTimeout(self.timeout);
|
||||
self.timeout = setTimeout(function() {
|
||||
self.$frame.attr({src: self.options.getFrame(position)});
|
||||
}, 250);
|
||||
return '<div style="text-align: center>"'
|
||||
+ (self.options.tooltip ? (
|
||||
Ox.isFunction(self.options.tooltip)
|
||||
? self.options.tooltip()
|
||||
: self.options.tooltip
|
||||
) + '<br>' : '')
|
||||
+ (tooltip ? tooltip + '<br>' : '')
|
||||
+ Ox.formatDuration(position, 2)
|
||||
+ '</div>';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue