2013-05-22 10:30:33 +08:00
|
|
|
/* ========================================================================
|
2013-12-19 06:56:08 +08:00
|
|
|
* Bootstrap: transition.js v3.1.0
|
2013-10-30 01:10:47 +08:00
|
|
|
* http://getbootstrap.com/javascript/#transitions
|
2013-05-22 10:30:33 +08:00
|
|
|
* ========================================================================
|
2013-05-17 02:06:30 +08:00
|
|
|
* Copyright 2013 Twitter, Inc.
|
2013-12-19 07:28:08 +08:00
|
|
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
2013-05-22 10:30:33 +08:00
|
|
|
* ======================================================================== */
|
2011-12-15 10:45:33 +08:00
|
|
|
|
2012-03-25 09:59:04 +08:00
|
|
|
|
2013-09-19 00:50:02 +08:00
|
|
|
+function ($) { 'use strict';
|
2011-12-15 10:45:33 +08:00
|
|
|
|
2013-05-17 08:18:15 +08:00
|
|
|
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
|
|
|
|
// ============================================================
|
2011-12-15 10:45:33 +08:00
|
|
|
|
2013-05-17 02:06:30 +08:00
|
|
|
function transitionEnd() {
|
2013-05-17 08:18:15 +08:00
|
|
|
var el = document.createElement('bootstrap')
|
2012-03-30 04:51:23 +08:00
|
|
|
|
2013-05-17 02:06:30 +08:00
|
|
|
var transEndEventNames = {
|
2013-12-16 03:04:32 +08:00
|
|
|
'WebkitTransition' : 'webkitTransitionEnd',
|
|
|
|
'MozTransition' : 'transitionend',
|
|
|
|
'OTransition' : 'oTransitionEnd otransitionend',
|
|
|
|
'transition' : 'transitionend'
|
2013-05-17 08:18:15 +08:00
|
|
|
}
|
2012-03-30 03:35:06 +08:00
|
|
|
|
2013-05-17 02:06:30 +08:00
|
|
|
for (var name in transEndEventNames) {
|
|
|
|
if (el.style[name] !== undefined) {
|
2013-05-17 08:18:15 +08:00
|
|
|
return { end: transEndEventNames[name] }
|
2012-01-18 02:32:25 +08:00
|
|
|
}
|
2013-05-17 02:06:30 +08:00
|
|
|
}
|
|
|
|
}
|
2012-03-30 04:51:23 +08:00
|
|
|
|
2013-07-24 09:44:08 +08:00
|
|
|
// http://blog.alexmaccaw.com/css-transitions
|
|
|
|
$.fn.emulateTransitionEnd = function (duration) {
|
2013-08-18 11:28:58 +08:00
|
|
|
var called = false, $el = this
|
2013-07-29 20:23:01 +08:00
|
|
|
$(this).one($.support.transition.end, function () { called = true })
|
|
|
|
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
|
2013-07-24 09:44:08 +08:00
|
|
|
setTimeout(callback, duration)
|
2013-07-27 11:34:39 +08:00
|
|
|
return this
|
2013-07-24 09:44:08 +08:00
|
|
|
}
|
|
|
|
|
2013-05-17 02:06:30 +08:00
|
|
|
$(function () {
|
2013-05-17 08:18:15 +08:00
|
|
|
$.support.transition = transitionEnd()
|
|
|
|
})
|
2012-02-14 10:41:02 +08:00
|
|
|
|
2013-08-23 02:50:15 +08:00
|
|
|
}(jQuery);
|