From 79e0a7681b3390dc6f181b92da386fe7727d00e9 Mon Sep 17 00:00:00 2001 From: hay-kot Date: Mon, 7 Jun 2021 22:14:10 -0800 Subject: [PATCH] fix force open on mobile --- frontend/src/components/UI/TheSidebar.vue | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/UI/TheSidebar.vue b/frontend/src/components/UI/TheSidebar.vue index d909eb7b4..d39f9b057 100644 --- a/frontend/src/components/UI/TheSidebar.vue +++ b/frontend/src/components/UI/TheSidebar.vue @@ -6,9 +6,7 @@ - - mdi-heart - + mdi-heart Favorites @@ -30,17 +28,13 @@ - - mdi-heart - + mdi-heart {{ $t("about.support") }} - - mdi-information - + mdi-information @@ -86,7 +80,8 @@ export default { }, mounted() { this.getVersion(); - this.resetView(); + + this.showSidebar = !this.isMobile; }, watch: { user() { @@ -98,7 +93,6 @@ export default { isMain() { const testVal = this.$route.path.split("/"); if (testVal[1] === "recipe") this.closeSidebar(); - else this.resetView(); return !(testVal[1] === "admin"); }, @@ -135,7 +129,7 @@ export default { const pages = this.$store.getters.getCustomPages; if (pages.length > 0) { pages.sort((a, b) => a.position - b.position); - return pages.map(x => ({ + return pages.map((x) => ({ title: x.name, to: `/pages/${x.slug}`, icon: this.$globals.icons.pages, @@ -217,9 +211,7 @@ export default { resetImage() { this.hideImage == false; }, - resetView() { - this.showSidebar = !this.isMobile; - }, + toggleSidebar() { this.showSidebar = !this.showSidebar; },