diff options
author | Johann-S <johann.servoire@gmail.com> | 2018-03-20 13:07:58 +0300 |
---|---|---|
committer | Johann-S <johann.servoire@gmail.com> | 2018-03-20 17:56:51 +0300 |
commit | bedc96e48bebb7a1124a97833794a8047a1e3b95 (patch) | |
tree | 0db43f0a301cf836fb9198a4957231a097a90f06 /js/src/util.js | |
parent | 2306f62bf19bb0696a9455aaf2eea6b083d9fdae (diff) |
Use transitionEnd in QUnit since we moved away from PhantomJS
Diffstat (limited to 'js/src/util.js')
-rw-r--r-- | js/src/util.js | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/js/src/util.js b/js/src/util.js index 1b1f13beae..f7a968de3d 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -14,8 +14,7 @@ const Util = (($) => { * ------------------------------------------------------------------------ */ - let transition = false - + const TRANSITION_END = 'transitionend' const MAX_UID = 1000000 const MILLISECONDS_MULTIPLIER = 1000 @@ -26,8 +25,8 @@ const Util = (($) => { function getSpecialTransitionEndEvent() { return { - bindType: transition.end, - delegateType: transition.end, + 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 @@ -37,16 +36,6 @@ const Util = (($) => { } } - function transitionEndTest() { - if (typeof window !== 'undefined' && window.QUnit) { - return false - } - - return { - end: 'transitionend' - } - } - function transitionEndEmulator(duration) { let called = false @@ -64,13 +53,8 @@ const Util = (($) => { } function setTransitionEndSupport() { - transition = transitionEndTest() - $.fn.emulateTransitionEnd = transitionEndEmulator - - if (Util.supportsTransitionEnd()) { - $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent() - } + $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent() } /** @@ -130,11 +114,12 @@ const Util = (($) => { }, triggerTransitionEnd(element) { - $(element).trigger(transition.end) + $(element).trigger(TRANSITION_END) }, + // TODO: Remove in v5 supportsTransitionEnd() { - return Boolean(transition) + return Boolean(TRANSITION_END) }, isElement(obj) { |