From 8d34bc136b54f4605595f228253463c90a3c5c97 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Mon, 21 Aug 2017 08:08:12 +0200 Subject: [PATCH] Move transition end detection to dom/event.js instead of util.js --- js/src/util.js | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/js/src/util.js b/js/src/util.js index 989d9644fc..2ffdec999b 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',