diff options
| author | Jacob Thornton <[email protected]> | 2011-10-31 22:44:42 -0700 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2011-10-31 22:44:42 -0700 |
| commit | 8f726dc6ef3ee725ef032ef4a11dbce26982ae24 (patch) | |
| tree | 80a7846a4186be4ee56a6f29e52ca6812fc38373 | |
| parent | 169b4b5dcbca740951735a60cc5c46a1366c2652 (diff) | |
| download | bootstrap-8f726dc6ef3ee725ef032ef4a11dbce26982ae24.tar.xz bootstrap-8f726dc6ef3ee725ef032ef4a11dbce26982ae24.zip | |
issue #240 - firefox drop css transition events :{o
| -rw-r--r-- | js/bootstrap-modal.js | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 9c57f6ddf..72b78d632 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -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') }) : @@ -118,7 +117,7 @@ .removeClass('in') $.support.transition && this.$element.hasClass('fade') ? - this.$element.one(transitionEnd, $.proxy(hideModal, this)) : + hideWithTransition.call(this) : hideModal.call(this) return this @@ -130,6 +129,20 @@ /* 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() |
