From: Quentin Spencer-Harper Date: Tue, 13 Jan 2015 14:59:47 +0000 (+0000) Subject: Tooltip: Avoid creating an unnecessary tooltip when `Tooltip#hide` is called X-Git-Tag: v3.3.4~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=acc5f6575698b8cbaf18892842301c10303c4502;p=thirdparty%2Fbootstrap.git Tooltip: Avoid creating an unnecessary tooltip when `Tooltip#hide` is called Fixed performance bug where a tooltip element is created and then immediately destroyed when tooltip.hide() is called and there is no existing tooltip element Resolves #15557 by merging it. --- diff --git a/js/tooltip.js b/js/tooltip.js index 0467c71d18..7f89a37ac8 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -292,7 +292,7 @@ Tooltip.prototype.hide = function (callback) { var that = this - var $tip = this.tip() + var $tip = $(this.$tip) var e = $.Event('hide.bs.' + this.type) function complete() { @@ -309,7 +309,7 @@ $tip.removeClass('in') - $.support.transition && this.$tip.hasClass('fade') ? + $.support.transition && $tip.hasClass('fade') ? $tip .one('bsTransitionEnd', complete) .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :