From f2997eda4641f790f174a11bb6a848751c69f445 Mon Sep 17 00:00:00 2001
From: alexisben <alex@noesya.coop>
Date: Wed, 27 Mar 2024 11:09:31 +0100
Subject: [PATCH] fix menu breakpoint

---
 assets/js/theme/design-system/mainMenu.js | 7 +++----
 assets/js/theme/utils/breakpoints.js      | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/assets/js/theme/design-system/mainMenu.js b/assets/js/theme/design-system/mainMenu.js
index cb24b4e1..feae6792 100644
--- a/assets/js/theme/design-system/mainMenu.js
+++ b/assets/js/theme/design-system/mainMenu.js
@@ -1,4 +1,4 @@
-import { breakpoints } from '../utils/breakpoints';
+import { breakpoints, isMobile } from '../utils/breakpoints';
 import { a11yClick } from '../utils/a11y';
 
 const CLASSES = {
@@ -59,16 +59,15 @@ class MainMenu {
     }
 
     resize () {
-        const isMobile = window.innerWidth <= breakpoints.md;
         document.documentElement.style.setProperty('--header-height', this.element.offsetHeight + 'px');
         document.documentElement.style.setProperty('--header-menu-max-height', (window.innerHeight - this.element.offsetHeight) + 'px');
 
         // is state changed ?
-        if (this.state.isMobile === isMobile) {
+        if (this.state.isMobile === isMobile()) {
             return null;
         }
 
-        this.state.isMobile = isMobile;
+        this.state.isMobile = isMobile();
 
         this.closeEverything();
     }
diff --git a/assets/js/theme/utils/breakpoints.js b/assets/js/theme/utils/breakpoints.js
index 4bb5c1e3..d0dba054 100644
--- a/assets/js/theme/utils/breakpoints.js
+++ b/assets/js/theme/utils/breakpoints.js
@@ -8,7 +8,7 @@ const breakpoints = {
 };
 
 const isMobile = function() {
-    return window.innerWidth <= breakpoints.md 
+    return window.innerWidth <= breakpoints.lg 
 }
 
 export {
-- 
GitLab