aboutsummaryrefslogtreecommitdiff
path: root/js/transition.js
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2013-07-23 18:44:08 -0700
committerJacob Thornton <[email protected]>2013-07-23 18:44:08 -0700
commitf1009c19b31c24df871b97efa74e8e10791bb2c3 (patch)
tree2bac5a675e252d6bf81fe6d17f345de508c0f313 /js/transition.js
parent43e5e90a6d871dbbca2ac68429324719692777d3 (diff)
downloadbootstrap-f1009c19b31c24df871b97efa74e8e10791bb2c3.tar.xz
bootstrap-f1009c19b31c24df871b97efa74e8e10791bb2c3.zip
revert collapse change + add emulateTransitionEvent to catch dead css transitions
Diffstat (limited to 'js/transition.js')
-rw-r--r--js/transition.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/js/transition.js b/js/transition.js
index 2ad53234a..c38460c15 100644
--- a/js/transition.js
+++ b/js/transition.js
@@ -40,6 +40,14 @@
}
}
+ // http://blog.alexmaccaw.com/css-transitions
+ $.fn.emulateTransitionEnd = function (duration) {
+ var called = false, $el = this
+ $(this).one('webkitTransitionEnd', function () { called = true })
+ var callback = function () { if (!called) $($el).trigger('webkitTransitionEnd') }
+ setTimeout(callback, duration)
+ }
+
$(function () {
$.support.transition = transitionEnd()
})