Skip to content

Commit

Permalink
Merge pull request #154 from 719media/patch-1
Browse files Browse the repository at this point in the history
isolate against bootstrap changes, remove old legacy ie9 code
  • Loading branch information
onokumus authored Dec 31, 2017
2 parents 524e4d3 + 7e8ae73 commit 5000f00
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions src/metisMenu.js
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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) {
Expand All @@ -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();
Expand Down Expand Up @@ -234,7 +219,7 @@ const MetisMenu = (($) => {
_el
.height(_el[0].scrollHeight)
.one(Util.TRANSITION_END, complete)
.emulateTransitionEnd(TRANSITION_DURATION);
.mmEmulateTransitionEnd(TRANSITION_DURATION);

}

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 5000f00

Please sign in to comment.