1 /* ========================================================================
2 * Bootstrap: transition.js v3.0.3
3 * http://getbootstrap.com/javascript/#transitions
4 * ========================================================================
5 * Copyright 2013 Twitter, Inc.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ======================================================================== */
21 +function ($) { "use strict";
23 // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
24 // ============================================================
26 function transitionEnd() {
27 var el = document.createElement('bootstrap')
29 var transEndEventNames = {
30 'WebkitTransition' : 'webkitTransitionEnd'
31 , 'MozTransition' : 'transitionend'
32 , 'OTransition' : 'oTransitionEnd otransitionend'
33 , 'transition' : 'transitionend'
36 for (var name in transEndEventNames) {
37 if (el.style[name] !== undefined) {
38 return { end: transEndEventNames[name] }
43 // http://blog.alexmaccaw.com/css-transitions
44 $.fn.emulateTransitionEnd = function (duration) {
45 var called = false, $el = this
46 $(this).one($.support.transition.end, function () { called = true })
47 var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
48 setTimeout(callback, duration)
53 $.support.transition = transitionEnd()