Skip to content

Commit

Permalink
wait for transition to end before triggering shown event
Browse files Browse the repository at this point in the history
  • Loading branch information
fat committed Sep 30, 2011
1 parent 2715a1e commit b2b8a78
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions js/bootstrap-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b2b8a78

Please sign in to comment.