2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-08 17:22:31 +03:00

add special transitionend type to test event origin

fixes #13430
This commit is contained in:
fat
2014-06-10 19:56:08 -07:00
parent 9cdbf0e807
commit 7f122be004
7 changed files with 24 additions and 25 deletions
+11 -1
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)
}
}
})
});