diff options
author | Prashant S | 2019-07-26 11:21:31 +0530 |
---|---|---|
committer | GitHub | 2019-07-26 11:21:31 +0530 |
commit | bfb41f58674f7c24bd41e6e6891f0773c3706ddc (patch) | |
tree | a407e9cac3242db67394711596835982160b0eaa /bootstrap/js/transition.js | |
parent | e5a79b1f0f70eb0bc413c5b85139617dbe84b07d (diff) | |
parent | 17bc989bd924aa4682807cf7920abb8558da0006 (diff) | |
download | fossee_istos-master.tar.gz fossee_istos-master.tar.bz2 fossee_istos-master.zip |
internship work for new theme for drupal-8.x
Diffstat (limited to 'bootstrap/js/transition.js')
-rwxr-xr-x | bootstrap/js/transition.js | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/bootstrap/js/transition.js b/bootstrap/js/transition.js new file mode 100755 index 0000000..5a9a3e3 --- /dev/null +++ b/bootstrap/js/transition.js @@ -0,0 +1,59 @@ +/* ======================================================================== + * Bootstrap: transition.js v3.4.1 + * https://getbootstrap.com/docs/3.4/javascript/#transitions + * ======================================================================== + * Copyright 2011-2019 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + * ======================================================================== */ + + ++function ($) { + 'use strict'; + + // CSS TRANSITION SUPPORT (Shoutout: https://modernizr.com/) + // ============================================================ + + function transitionEnd() { + var el = document.createElement('bootstrap') + + var transEndEventNames = { + WebkitTransition : 'webkitTransitionEnd', + MozTransition : 'transitionend', + OTransition : 'oTransitionEnd otransitionend', + transition : 'transitionend' + } + + for (var name in transEndEventNames) { + if (el.style[name] !== undefined) { + return { end: transEndEventNames[name] } + } + } + + return false // explicit for ie8 ( ._.) + } + + // https://blog.alexmaccaw.com/css-transitions + $.fn.emulateTransitionEnd = function (duration) { + var called = false + var $el = this + $(this).one('bsTransitionEnd', function () { called = true }) + var callback = function () { if (!called) $($el).trigger($.support.transition.end) } + setTimeout(callback, duration) + return this + } + + $(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) + } + } + }) + +}(jQuery); |