mirror of
https://github.com/Hopiu/bootstrap.git
synced 2026-05-22 10:21:51 +00:00
wait for transition to end before triggering shown event
This commit is contained in:
parent
2715a1e09e
commit
b2b8a78971
1 changed files with 8 additions and 2 deletions
10
js/bootstrap-modal.js
vendored
10
js/bootstrap-modal.js
vendored
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue