diff client/src/components/Sidebar.vue @ 1282:a7dd8a3356fc

fixed contextBox animations
author Markus Kottlaender <markus@intevation.de>
date Thu, 22 Nov 2018 10:20:21 +0100
parents bc55ffaeb639
children e1480ad4b6b0
line wrap: on
line diff
--- a/client/src/components/Sidebar.vue	Thu Nov 22 08:57:38 2018 +0100
+++ b/client/src/components/Sidebar.vue	Thu Nov 22 10:20:21 2018 +0100
@@ -96,7 +96,7 @@
     ...mapState("application", [
       "showSidebar",
       "showSearchbarLastState",
-      "showInContextBox"
+      "contextBoxContent"
     ]),
     menuStyle() {
       return {
@@ -124,21 +124,10 @@
       this.$router.push("/login");
     },
     toggleContextBox(context) {
-      const SHOW = context;
-      const HIDE = null;
-      const isElementAlreadyShown = this.showInContextBox === context;
-      let toggleState =
-        isElementAlreadyShown && this.routeName === "mainview" ? HIDE : SHOW;
       this.$router.push("/");
-      this.$store.commit("application/showInContextBox", toggleState);
-      if (this.showInContextBox === context) {
-        this.$store.commit("application/showSearchbar", true);
-      } else {
-        this.$store.commit(
-          "application/showSearchbar",
-          this.showSearchbarLastState
-        );
-      }
+      this.$store.commit("application/showContextBox", true);
+      this.$store.commit("application/contextBoxContent", context);
+      this.$store.commit("application/showSearchbar", true);
     }
   }
 };