Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isolate against bootstrap changes, remove old legacy ie9 code #154

Merged
merged 1 commit into from
Dec 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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