]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
clean up dead elements in firefox (which is droping transitionEnd events :(
authorJacob Thornton <jacobthornton@gmail.com>
Sun, 25 Dec 2011 07:06:16 +0000 (23:06 -0800)
committerJacob Thornton <jacobthornton@gmail.com>
Sun, 25 Dec 2011 07:06:16 +0000 (23:06 -0800)
js/bootstrap-twipsy.js

index 2651e3822640721471ace7a70100853c47431526..a176f09088e248ccbde8bb827d2bcfc154379c6a 100644 (file)
 
       $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 () {