From a567b565e9e6a895c55522e3b78c9e6b69caf501 Mon Sep 17 00:00:00 2001 From: Gator Date: Mon, 5 Dec 2022 12:50:52 +0100 Subject: [PATCH] hot sexy fixes for active menu --- src/components/MainMenu.vue | 23 +++++++++++++++++++---- src/components/Menu2dCA.vue | 8 ++++++++ src/components/MenuRow.vue | 32 +++++++++++++++++++------------- 3 files changed, 46 insertions(+), 17 deletions(-) diff --git a/src/components/MainMenu.vue b/src/components/MainMenu.vue index a1c3488..b5c7f27 100644 --- a/src/components/MainMenu.vue +++ b/src/components/MainMenu.vue @@ -1,9 +1,9 @@ @@ -20,6 +20,21 @@ MenuElementaryCA, Menu2dCA, }, + data() { + return { + active: "", + }; + }, + methods: { + // set the opened submenu. If already active, reset it so it can close + updateActive(menu) { + if (menu === this.active) { + this.active = ""; + } else { + this.active = menu; + } + }, + }, }; diff --git a/src/components/Menu2dCA.vue b/src/components/Menu2dCA.vue index 49b5cb0..58a410b 100644 --- a/src/components/Menu2dCA.vue +++ b/src/components/Menu2dCA.vue @@ -13,6 +13,11 @@ +
+
+ + +
@@ -28,6 +33,9 @@ }, methods: { ...mapActions(globalStore, ["toggleDraw2dLast", "toggleDraw2d"]), + previewFile(event) { + console.log(event.target.files); + }, }, }; diff --git a/src/components/MenuRow.vue b/src/components/MenuRow.vue index 164414f..ef7c801 100644 --- a/src/components/MenuRow.vue +++ b/src/components/MenuRow.vue @@ -1,9 +1,9 @@