aboutsummaryrefslogtreecommitdiff
path: root/js/modal.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/modal.js')
-rw-r--r--js/modal.js31
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) {