]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
issue #240 - firefox drop css transition events :{o
authorJacob Thornton <jacobthornton@gmail.com>
Tue, 1 Nov 2011 05:44:42 +0000 (22:44 -0700)
committerJacob Thornton <jacobthornton@gmail.com>
Tue, 1 Nov 2011 05:44:42 +0000 (22:44 -0700)
js/bootstrap-modal.js

index 9c57f6ddf356c376acebbde0004f78225c61d5af..72b78d63293441b445767efafba48d79d9b642f0 100644 (file)
@@ -89,8 +89,7 @@
             that.$element[0].offsetWidth // force reflow
           }
 
-          that.$element
-            .addClass('in')
+          that.$element.addClass('in')
 
           transition ?
             that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
           .removeClass('in')
 
         $.support.transition && this.$element.hasClass('fade') ?
-          this.$element.one(transitionEnd, $.proxy(hideModal, this)) :
+          hideWithTransition.call(this) :
           hideModal.call(this)
 
         return this
  /* MODAL PRIVATE METHODS
   * ===================== */
 
+  function hideWithTransition() {
+    // firefox drops transitionEnd events :{o
+    var that = this
+      , timeout = setTimeout(function () {
+          that.$element.unbind(transitionEnd)
+          hideModal.call(that)
+        }, 500)
+
+    this.$element.one(transitionEnd, function () {
+      clearTimeout(timeout)
+      hideModal.call(that)
+    })
+  }
+
   function hideModal (that) {
     this.$element
       .hide()