mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-17 10:40:55 +01:00
Reading and applying delay of quickopen from settings
This commit is contained in:
@@ -54,13 +54,14 @@ export default class Sidebar {
|
|||||||
|
|
||||||
quickOpenIn(/* event */) {
|
quickOpenIn(/* event */) {
|
||||||
let isDesktop = global.matchMedia(DESKTOP_QUERY).matches;
|
let isDesktop = global.matchMedia(DESKTOP_QUERY).matches;
|
||||||
|
let delay = $('#admin-sidebar').data('quickopen-delay') || 500;
|
||||||
let shouldQuickOpen = isDesktop ? this.body.hasClass('sidebar-closed') : !this.body.hasClass('sidebar-open');
|
let shouldQuickOpen = isDesktop ? this.body.hasClass('sidebar-closed') : !this.body.hasClass('sidebar-open');
|
||||||
if (!shouldQuickOpen && !this.body.hasClass('sidebar-quickopen')) { return this.quickOpenOut(); }
|
if (!shouldQuickOpen && !this.body.hasClass('sidebar-quickopen')) { return this.quickOpenOut(); }
|
||||||
|
|
||||||
this.timeout = setTimeout(() => {
|
this.timeout = setTimeout(() => {
|
||||||
this.body.addClass('sidebar-open sidebar-quickopen');
|
this.body.addClass('sidebar-open sidebar-quickopen');
|
||||||
$(global).trigger('sidebar_state._grav', isDesktop);
|
$(global).trigger('sidebar_state._grav', isDesktop);
|
||||||
}, 500);
|
}, delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
quickOpenOut(/* event */) {
|
quickOpenOut(/* event */) {
|
||||||
|
|||||||
4
themes/grav/js/admin.min.js
vendored
4
themes/grav/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user