Browse Source

enhanced PushMenu's autoCollapse feature

pull/2630/head
REJack 5 years ago
parent
commit
282ff7f6ce
  1. 10
      build/js/PushMenu.js
  2. 10
      dist/js/adminlte.js
  3. 2
      dist/js/adminlte.js.map
  4. 2
      dist/js/adminlte.min.js
  5. 2
      dist/js/adminlte.min.js.map

10
build/js/PushMenu.js

@ -37,9 +37,9 @@ const PushMenu = (($) => {
}
const ClassName = {
SIDEBAR_OPEN: 'sidebar-open',
COLLAPSED: 'sidebar-collapse',
OPEN: 'sidebar-open'
OPEN: 'sidebar-open',
CLOSED: 'sidebar-closed'
}
/**
@ -68,7 +68,7 @@ const PushMenu = (($) => {
}
}
$(Selector.BODY).removeClass(ClassName.COLLAPSED)
$(Selector.BODY).removeClass(ClassName.COLLAPSED).removeClass(ClassName.CLOSED)
if(this._options.enableRemember) {
localStorage.setItem(`remember${EVENT_KEY}`, ClassName.OPEN)
@ -81,7 +81,7 @@ const PushMenu = (($) => {
collapse() {
if (this._options.autoCollapseSize) {
if ($(window).width() <= this._options.autoCollapseSize) {
$(Selector.BODY).removeClass(ClassName.OPEN)
$(Selector.BODY).removeClass(ClassName.OPEN).addClass(ClassName.CLOSED)
}
}
@ -112,6 +112,8 @@ const PushMenu = (($) => {
} else if (resize == true) {
if ($(Selector.BODY).hasClass(ClassName.OPEN)) {
$(Selector.BODY).removeClass(ClassName.OPEN)
} else if($(Selector.BODY).hasClass(ClassName.CLOSED)) {
this.expand()
}
}
}

10
dist/js/adminlte.js vendored

@ -546,9 +546,9 @@
WRAPPER: '.wrapper'
};
var ClassName = {
SIDEBAR_OPEN: 'sidebar-open',
COLLAPSED: 'sidebar-collapse',
OPEN: 'sidebar-open'
OPEN: 'sidebar-open',
CLOSED: 'sidebar-closed'
};
/**
* Class Definition
@ -579,7 +579,7 @@
}
}
$(Selector.BODY).removeClass(ClassName.COLLAPSED);
$(Selector.BODY).removeClass(ClassName.COLLAPSED).removeClass(ClassName.CLOSED);
if (this._options.enableRemember) {
localStorage.setItem("remember" + EVENT_KEY, ClassName.OPEN);
@ -592,7 +592,7 @@
_proto.collapse = function collapse() {
if (this._options.autoCollapseSize) {
if ($(window).width() <= this._options.autoCollapseSize) {
$(Selector.BODY).removeClass(ClassName.OPEN);
$(Selector.BODY).removeClass(ClassName.OPEN).addClass(ClassName.CLOSED);
}
}
@ -627,6 +627,8 @@
} else if (resize == true) {
if ($(Selector.BODY).hasClass(ClassName.OPEN)) {
$(Selector.BODY).removeClass(ClassName.OPEN);
} else if ($(Selector.BODY).hasClass(ClassName.CLOSED)) {
this.expand();
}
}
}

2
dist/js/adminlte.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/js/adminlte.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/js/adminlte.min.js.map vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save