mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-31 09:05:47 +02:00
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.
This commit is contained in:
committed by
Heinrich Fenkart
parent
f43c67b0c5
commit
acc5f65756
@@ -292,7 +292,7 @@
|
|||||||
|
|
||||||
Tooltip.prototype.hide = function (callback) {
|
Tooltip.prototype.hide = function (callback) {
|
||||||
var that = this
|
var that = this
|
||||||
var $tip = this.tip()
|
var $tip = $(this.$tip)
|
||||||
var e = $.Event('hide.bs.' + this.type)
|
var e = $.Event('hide.bs.' + this.type)
|
||||||
|
|
||||||
function complete() {
|
function complete() {
|
||||||
@@ -309,7 +309,7 @@
|
|||||||
|
|
||||||
$tip.removeClass('in')
|
$tip.removeClass('in')
|
||||||
|
|
||||||
$.support.transition && this.$tip.hasClass('fade') ?
|
$.support.transition && $tip.hasClass('fade') ?
|
||||||
$tip
|
$tip
|
||||||
.one('bsTransitionEnd', complete)
|
.one('bsTransitionEnd', complete)
|
||||||
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
|
.emulateTransitionEnd(Tooltip.TRANSITION_DURATION) :
|
||||||
|
Reference in New Issue
Block a user