Commit 8f726dc6 authored by Jacob Thornton's avatar Jacob Thornton

issue #240 - firefox drop css transition events :{o

parent 169b4b5d
...@@ -89,8 +89,7 @@ ...@@ -89,8 +89,7 @@
that.$element[0].offsetWidth // force reflow that.$element[0].offsetWidth // force reflow
} }
that.$element that.$element.addClass('in')
.addClass('in')
transition ? transition ?
that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) : that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
...@@ -118,7 +117,7 @@ ...@@ -118,7 +117,7 @@
.removeClass('in') .removeClass('in')
$.support.transition && this.$element.hasClass('fade') ? $.support.transition && this.$element.hasClass('fade') ?
this.$element.one(transitionEnd, $.proxy(hideModal, this)) : hideWithTransition.call(this) :
hideModal.call(this) hideModal.call(this)
return this return this
...@@ -130,6 +129,20 @@ ...@@ -130,6 +129,20 @@
/* MODAL PRIVATE METHODS /* 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) { function hideModal (that) {
this.$element this.$element
.hide() .hide()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment