VENOM-10: added new function isMobileDevice
This commit is contained in:
parent
2d9fbc3b99
commit
1e4e71ad9c
1 changed files with 15 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue