Commit b2b8a789 authored by Jacob Thornton's avatar Jacob Thornton

wait for transition to end before triggering shown event

parent 2715a1e0
...@@ -81,17 +81,23 @@ ...@@ -81,17 +81,23 @@
escape.call(this) escape.call(this)
backdrop.call(this, function () { backdrop.call(this, function () {
var transition = $.support.transition && that.$element.hasClass('fade')
that.$element that.$element
.appendTo(document.body) .appendTo(document.body)
.show() .show()
if ($.support.transition && that.$element.hasClass('fade')) { if (transition) {
that.$element[0].offsetWidth // force reflow that.$element[0].offsetWidth // force reflow
} }
that.$element that.$element
.addClass('in') .addClass('in')
.trigger('shown')
transition ?
that.$element.one(transitionEnd, function () { that.$element.trigger('shown') }) :
that.$element.trigger('shown')
}) })
return this return this
......
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