1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-10-01 15:56:45 +02:00

Merge pull request #13786 from twbs/fat-13430

add special transitionend type to test event origin
This commit is contained in:
Jacob
2014-06-11 22:44:04 -07:00
7 changed files with 24 additions and 25 deletions

View File

@@ -40,7 +40,7 @@
$.fn.emulateTransitionEnd = function (duration) {
var called = false
var $el = this
$(this).one($.support.transition.end, function () { called = true })
$(this).one('bsTransitionEnd', function () { called = true })
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
setTimeout(callback, duration)
return this
@@ -48,6 +48,16 @@
$(function () {
$.support.transition = transitionEnd()
if (!$.support.transition) return
$.event.special.bsTransitionEnd = {
bindType: $.support.transition.end,
delegateType: $.support.transition.end,
handle: function (e) {
if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
}
}
})
});