]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Tooltip: Avoid creating an unnecessary tooltip when `Tooltip#hide` is called
authorQuentin Spencer-Harper <qspencer-harper@palantir.com>
Tue, 13 Jan 2015 14:59:47 +0000 (14:59 +0000)
committerHeinrich Fenkart <hnrch02@gmail.com>
Thu, 26 Feb 2015 05:53:58 +0000 (06:53 +0100)
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.

js/tooltip.js

index 0467c71d18dc3abe7942f884862de521515142dd..7f89a37ac8efc8accfa3036d4745608084767d05 100644 (file)
 
   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() {
 
     $tip.removeClass('in')
 
-    $.support.transition && this.$tip.hasClass('fade') ?
+    $.support.transition && $tip.hasClass('fade') ?
       $tip
         .one('bsTransitionEnd', complete)
         .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :