aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/bootstrap-twipsy.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/js/bootstrap-twipsy.js b/js/bootstrap-twipsy.js
index 2651e3822..a176f0908 100644
--- a/js/bootstrap-twipsy.js
+++ b/js/bootstrap-twipsy.js
@@ -164,13 +164,20 @@
$tip.removeClass('in')
- function removeElement () {
- $tip.remove()
+ function removeWithAnimation() {
+ var timeout = setTimeout(function () {
+ $tip.off($.support.transition.end).remove()
+ }, 500)
+
+ $tip.one($.support.transition.end, function () {
+ clearTimeout(timeout)
+ $tip.remove()
+ })
}
$.support.transition && this.$tip.hasClass('fade') ?
- $tip.on($.support.transition.end, removeElement) :
- removeElement()
+ removeWithAnimation() :
+ $tip.remove()
}
, fixTitle: function () {