From 062d4eb6181f9154d2e2fc01a8e78b49b600a3d1 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Tue, 2 Jun 2020 11:47:51 +0200
Subject: [PATCH] Don't toggle the responsive menu when using the desktop one

---
 packages/app-shell/src/app-shell.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/packages/app-shell/src/app-shell.js b/packages/app-shell/src/app-shell.js
index e3c67977..4e10b848 100644
--- a/packages/app-shell/src/app-shell.js
+++ b/packages/app-shell/src/app-shell.js
@@ -306,7 +306,7 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
         const link = e.composedPath()[0];
         const location = link.getAttribute('href');
         this.router.updateFromPathname(location);
-        this.toggleMenu();
+        this.hideMenu();
     }
 
     onLanguageChanged(e) {
@@ -383,6 +383,12 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
         }
     }
 
+    hideMenu() {
+        const menu = this.shadowRoot.querySelector("ul.menu");
+        if (menu && !menu.classList.contains('hidden'))
+            this.toggleMenu();
+    }
+
     static get styles() {
         // language=css
         return css`
@@ -725,7 +731,7 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
                     </h2>
                     <ul class="menu hidden">
                         ${menuTemplates}
-                        <li class="close" @click="${this.toggleMenu}"><vpu-icon name="close" style="color: red"></vpu-icon></li>
+                        <li class="close" @click="${this.hideMenu}"><vpu-icon name="close" style="color: red"></vpu-icon></li>
                     </ul>
                 </aside>
 
-- 
GitLab