diff options
| author | Jacob Thornton <[email protected]> | 2013-07-23 18:44:08 -0700 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2013-07-23 18:44:08 -0700 |
| commit | f1009c19b31c24df871b97efa74e8e10791bb2c3 (patch) | |
| tree | 2bac5a675e252d6bf81fe6d17f345de508c0f313 /js/modal.js | |
| parent | 43e5e90a6d871dbbca2ac68429324719692777d3 (diff) | |
| download | bootstrap-f1009c19b31c24df871b97efa74e8e10791bb2c3.tar.xz bootstrap-f1009c19b31c24df871b97efa74e8e10791bb2c3.zip | |
revert collapse change + add emulateTransitionEvent to catch dead css transitions
Diffstat (limited to 'js/modal.js')
| -rw-r--r-- | js/modal.js | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/js/modal.js b/js/modal.js index 50ebd7b56..5a234146e 100644 --- a/js/modal.js +++ b/js/modal.js @@ -74,7 +74,11 @@ that.enforceFocus() transition ? - that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown.bs.modal') }) : + that.$element + .one($.support.transition.end, function () { + that.$element.focus().trigger('shown.bs.modal') + }) + .emulateTransitionEnd(300) : that.$element.focus().trigger('shown.bs.modal') }) } @@ -99,7 +103,9 @@ .attr('aria-hidden', true) $.support.transition && this.$element.hasClass('fade') ? - this.hideWithTransition() : + this.$element + .one($.support.transition.end, $.proxy(this.hideModal, this)) + .emulateTransitionEnd(300) : this.hideModal() } @@ -123,19 +129,6 @@ } } - Modal.prototype.hideWithTransition = function () { - var that = this - var timeout = setTimeout(function () { - that.$element.off($.support.transition.end) - that.hideModal() - }, 500) - - this.$element.one($.support.transition.end, function () { - clearTimeout(timeout) - that.hideModal() - }) - } - Modal.prototype.hideModal = function () { var that = this this.$element.hide() @@ -174,14 +167,18 @@ if (!callback) return doAnimate ? - this.$backdrop.one($.support.transition.end, callback) : + this.$backdrop + .one($.support.transition.end, callback) + .emulateTransitionEnd(150) : callback() } else if (!this.isShown && this.$backdrop) { this.$backdrop.removeClass('in') $.support.transition && this.$element.hasClass('fade')? - this.$backdrop.one($.support.transition.end, callback) : + this.$backdrop + .one($.support.transition.end, callback) + .emulateTransitionEnd(150) : callback() } else if (callback) { |
