aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2011-09-29 23:38:11 -0700
committerJacob Thornton <[email protected]>2011-09-29 23:38:11 -0700
commitb2b8a789718d8a2cc3248509a94eee36ead6f504 (patch)
tree64c64112019d648a6e86ac829e0f7b8b6b033af3 /js
parent2715a1e09e6106a37170afbaf3a8f2bb8355efa7 (diff)
downloadbootstrap-b2b8a789718d8a2cc3248509a94eee36ead6f504.tar.xz
bootstrap-b2b8a789718d8a2cc3248509a94eee36ead6f504.zip
wait for transition to end before triggering shown event
Diffstat (limited to 'js')
-rw-r--r--js/bootstrap-modal.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js
index 41bb540a1..72b7e3525 100644
--- a/js/bootstrap-modal.js
+++ b/js/bootstrap-modal.js
@@ -81,17 +81,23 @@
escape.call(this)
backdrop.call(this, function () {
+ var transition = $.support.transition && that.$element.hasClass('fade')
+
that.$element
.appendTo(document.body)
.show()
- if ($.support.transition && that.$element.hasClass('fade')) {
+ if (transition) {
that.$element[0].offsetWidth // force reflow
}
that.$element
.addClass('in')
- .trigger('shown')
+
+ transition ?
+ that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
+ that.$element.trigger('shown')
+
})
return this