From 66546fc3c535e1851dcc38bde5c453a60d35157c Mon Sep 17 00:00:00 2001 From: mat-mo Date: Sun, 17 Nov 2013 00:06:26 +0200 Subject: [PATCH] Solve https://bugzilla.wikimedia.org/show_bug.cgi?id=57144 This patch was suggested by Kipod, push by me in order to fix upstream. --- src/javascripts/jquery.tipsy.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/javascripts/jquery.tipsy.js b/src/javascripts/jquery.tipsy.js index f95c063..4e5ac33 100644 --- a/src/javascripts/jquery.tipsy.js +++ b/src/javascripts/jquery.tipsy.js @@ -31,6 +31,9 @@ $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title); $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity + if (this.options.className) { + $tip.addClass(maybeCall(this.options.className, this.$element[0])); + } $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body); var pos = $.extend({}, this.$element.offset(), { @@ -68,9 +71,7 @@ $tip.css(tp).addClass('tipsy-' + gravity); $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0); - if (this.options.className) { - $tip.addClass(maybeCall(this.options.className, this.$element[0])); - } + if (this.options.fade) { $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});