diff options
| author | Johann-S <[email protected]> | 2017-08-21 08:08:12 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2019-02-20 22:05:45 +0200 |
| commit | 8d34bc136b54f4605595f228253463c90a3c5c97 (patch) | |
| tree | 330977c50821ae502c02538ed1b293d93063e41e /js/src | |
| parent | fb465c474588b0229f84793f540af1bc12fb590b (diff) | |
| download | bootstrap-8d34bc136b54f4605595f228253463c90a3c5c97.tar.xz bootstrap-8d34bc136b54f4605595f228253463c90a3c5c97.zip | |
Move transition end detection to dom/event.js instead of util.js
Diffstat (limited to 'js/src')
| -rw-r--r-- | js/src/util.js | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/js/src/util.js b/js/src/util.js index 989d9644f..2ffdec999 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -22,46 +22,6 @@ function toType(obj) { return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase() } -function getSpecialTransitionEndEvent() { - return { - bindType: TRANSITION_END, - delegateType: TRANSITION_END, - handle(event) { - if ($(event.target).is(this)) { - return event.handleObj.handler.apply(this, arguments) // eslint-disable-line prefer-rest-params - } - return undefined // eslint-disable-line no-undefined - } - } -} - -function transitionEndEmulator(duration) { - let called = false - - $(this).one(Util.TRANSITION_END, () => { - called = true - }) - - setTimeout(() => { - if (!called) { - Util.triggerTransitionEnd(this) - } - }, duration) - - return this -} - -function setTransitionEndSupport() { - $.fn.emulateTransitionEnd = transitionEndEmulator - $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent() -} - -/** - * -------------------------------------------------------------------------- - * Public Util Api - * -------------------------------------------------------------------------- - */ - const Util = { TRANSITION_END: 'bsTransitionEnd', |
