From 7e8ae731ac0a56cc38ad384a283d44232b2807c4 Mon Sep 17 00:00:00 2001 From: 719media <719media@users.noreply.github.com> Date: Sat, 30 Dec 2017 16:39:30 -0800 Subject: [PATCH] Update metisMenu.js --- src/metisMenu.js | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/src/metisMenu.js b/src/metisMenu.js index 254f672..0061f2e 100644 --- a/src/metisMenu.js +++ b/src/metisMenu.js @@ -1,13 +1,6 @@ const Util = (($) => { let transition = false; - const TransitionEndEvent = { - WebkitTransition: 'webkitTransitionEnd', - MozTransition: 'transitionend', - OTransition: 'oTransitionEnd otransitionend', - transition: 'transitionend' - }; - function getSpecialTransitionEndEvent() { return { bindType: transition.end, @@ -28,18 +21,10 @@ const Util = (($) => { if (window.QUnit) { return false; } - - const el = document.createElement('mm'); - - for (const name in TransitionEndEvent) { - if (el.style[name] !== undefined) { - return { - end: TransitionEndEvent[name] - }; - } - } - - return false; + + return { + end: 'transitionend' + }; } function transitionEndEmulator(duration) { @@ -60,7 +45,7 @@ const Util = (($) => { function setTransitionEndSupport() { transition = transitionEndTest(); - $.fn.emulateTransitionEnd = transitionEndEmulator; + $.fn.mmEmulateTransitionEnd = transitionEndEmulator; if (Util.supportsTransitionEnd()) { $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); @@ -234,7 +219,7 @@ const MetisMenu = (($) => { _el .height(_el[0].scrollHeight) .one(Util.TRANSITION_END, complete) - .emulateTransitionEnd(TRANSITION_DURATION); + .mmEmulateTransitionEnd(TRANSITION_DURATION); } @@ -290,7 +275,7 @@ const MetisMenu = (($) => { (_el.height() == 0 || _el.css('display') == 'none') ? complete() : _el .height(0) .one(Util.TRANSITION_END, complete) - .emulateTransitionEnd(TRANSITION_DURATION); + .mmEmulateTransitionEnd(TRANSITION_DURATION); } setTransitioning(isTransitioning) {