diff --git a/public/theme/admin/js/scripts.js b/public/theme/admin/js/scripts.js index c943fb7..0bf8cc0 100644 --- a/public/theme/admin/js/scripts.js +++ b/public/theme/admin/js/scripts.js @@ -679,6 +679,21 @@ class FormHandler { customElements.define("v-editor", VEditor); })(); +(() => { + const mobileBreakpoint = 1023; + const main = $('main'); + + function isMobileDevice() { + return window.matchMedia("(max-width: " + mobileBreakpoint + "px)").matches; + } + window.isMobileDevice = isMobileDevice; + $('body').addDelegatedEventListener('click', '.nav-toggle', (e, el) => { + if (isMobileDevice()) { + main.classList.toggle('nav-open'); + } + }); + +})(); (() => { class Router { constructor(options) {