1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-23 21:53:25 +02:00

not feeling the slide in

This commit is contained in:
Jacob Thornton
2011-09-10 18:26:37 -07:00
parent 9c76070cbd
commit 235246d6fc
4 changed files with 17 additions and 45 deletions

30
js/bootstrap-modal.js vendored
View File

@@ -59,17 +59,16 @@
this.isShown = true
_.escape.call(this)
_.backdrop.call(this, function () {
_.backdrop.call(this)
that.$element
.appendTo(document.body)
.show()
this.$element
.appendTo(document.body)
.show()
setTimeout(function () {
that.$element.addClass('in').trigger('modal:shown')
}, 1)
})
setTimeout(function () {
that.$element.addClass('in').trigger('modal:shown')
that.$backdrop && that.$backdrop.addClass('in')
}, 1)
return this
}
@@ -82,12 +81,11 @@
this.isShown = false
_.escape.call(this)
_.backdrop.call(this)
this.$element.removeClass('in')
function removeElement () {
_.backdrop.call(that)
that.$element
.detach()
.trigger('modal:hidden')
@@ -108,21 +106,13 @@
var _ = {
backdrop: function ( callback ) {
backdrop: function () {
var that = this
, animate = this.$element.hasClass('fade') ? 'fade' : ''
if ( this.isShown && this.settings.backdrop ) {
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.click($.proxy(this.hide, this))
.appendTo(document.body)
setTimeout(function () {
that.$backdrop && that.$backdrop.addClass('in')
$.support.transition && that.$backdrop.hasClass('fade')?
that.$backdrop.one(transitionEnd, callback) :
callback()
})
} else if ( !this.isShown && this.$backdrop ) {
this.$backdrop.removeClass('in')