aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfat <[email protected]>2013-12-25 20:03:28 -0800
committerfat <[email protected]>2013-12-25 20:03:28 -0800
commitc25fa0661aa974019664e21517d2122dccf70095 (patch)
tree356e1b73520ccd25ebc5198e2756d99b66d1f309
parentdffd4ffad2b6cad7fb0bab747671d524d791054d (diff)
parent0adb4e35f0d773caa6cff65a6f760001089c5ffb (diff)
downloadbootstrap-c25fa0661aa974019664e21517d2122dccf70095.tar.xz
bootstrap-c25fa0661aa974019664e21517d2122dccf70095.zip
Merge branch 'tooltip-events-fix' of git://github.com/lukaszfiszer/bootstrap into lukaszfiszer-tooltip-events-fix
Conflicts: js/tooltip.js
-rw-r--r--js/tooltip.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/js/tooltip.js b/js/tooltip.js
index 9d1e8421b..4c0e4bdcd 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
}