2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-30 15:24:08 +03:00

revert collapse change + add emulateTransitionEvent to catch dead css transitions

This commit is contained in:
Jacob Thornton
2013-07-23 18:44:08 -07:00
parent 43e5e90a6d
commit f1009c19b3
10 changed files with 91 additions and 85 deletions
+14 -17
View File
@@ -74,7 +74,11 @@
that.enforceFocus()
transition ?
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown.bs.modal') }) :
that.$element
.one($.support.transition.end, function () {
that.$element.focus().trigger('shown.bs.modal')
})
.emulateTransitionEnd(300) :
that.$element.focus().trigger('shown.bs.modal')
})
}
@@ -99,7 +103,9 @@
.attr('aria-hidden', true)
$.support.transition && this.$element.hasClass('fade') ?
this.hideWithTransition() :
this.$element
.one($.support.transition.end, $.proxy(this.hideModal, this))
.emulateTransitionEnd(300) :
this.hideModal()
}
@@ -123,19 +129,6 @@
}
}
Modal.prototype.hideWithTransition = function () {
var that = this
var timeout = setTimeout(function () {
that.$element.off($.support.transition.end)
that.hideModal()
}, 500)
this.$element.one($.support.transition.end, function () {
clearTimeout(timeout)
that.hideModal()
})
}
Modal.prototype.hideModal = function () {
var that = this
this.$element.hide()
@@ -174,14 +167,18 @@
if (!callback) return
doAnimate ?
this.$backdrop.one($.support.transition.end, callback) :
this.$backdrop
.one($.support.transition.end, callback)
.emulateTransitionEnd(150) :
callback()
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')
$.support.transition && this.$element.hasClass('fade')?
this.$backdrop.one($.support.transition.end, callback) :
this.$backdrop
.one($.support.transition.end, callback)
.emulateTransitionEnd(150) :
callback()
} else if (callback) {