diff --git a/js/tooltip.js b/js/tooltip.js index 9d1e8421bf..4c0e4bdcdf 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -128,6 +128,7 @@ this.$element.trigger(e) if (e.isDefaultPrevented()) return + var that = this; var $tip = this.tip() @@ -178,7 +179,16 @@ this.applyPlacement(calculatedOffset, placement) this.hoverState = null - this.$element.trigger('shown.bs.' + this.type) + + var complete = function() { + that.$element.trigger('shown.bs.' + that.type) + } + + $.support.transition && this.$tip.hasClass('fade') ? + $tip + .one($.support.transition.end, complete) + .emulateTransitionEnd(150) : + complete() } } @@ -261,6 +271,7 @@ function complete() { if (that.hoverState != 'in') $tip.detach() + that.$element.trigger('hidden.bs.' + that.type) } this.$element.trigger(e) @@ -276,7 +287,6 @@ complete() this.hoverState = null - this.$element.trigger('hidden.bs.' + this.type) return this }