From c567a80a4444b2ec938c3a3ff4c8f2c0bd71a2f4 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 11 Feb 2013 11:57:37 +0530 Subject: [PATCH] VideoPreview: accept tooltip function --- source/Ox.UI/js/Video/VideoPreview.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/Ox.UI/js/Video/VideoPreview.js b/source/Ox.UI/js/Video/VideoPreview.js index 94c20764..528c6ea2 100644 --- a/source/Ox.UI/js/Video/VideoPreview.js +++ b/source/Ox.UI/js/Video/VideoPreview.js @@ -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 '
' : '') + + (tooltip ? tooltip + '
' : '') + Ox.formatDuration(position, 2) + '
'; }