comparison 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
comparison
equal deleted inserted replaced
1278:8f4bf8576acd 1282:a7dd8a3356fc
94 ...mapGetters("user", ["isSysAdmin", "isWaterwayAdmin"]), 94 ...mapGetters("user", ["isSysAdmin", "isWaterwayAdmin"]),
95 ...mapState("user", ["user"]), 95 ...mapState("user", ["user"]),
96 ...mapState("application", [ 96 ...mapState("application", [
97 "showSidebar", 97 "showSidebar",
98 "showSearchbarLastState", 98 "showSearchbarLastState",
99 "showInContextBox" 99 "contextBoxContent"
100 ]), 100 ]),
101 menuStyle() { 101 menuStyle() {
102 return { 102 return {
103 menu: true, 103 menu: true,
104 nav: true, 104 nav: true,
122 this.$store.commit("application/showUsermenu", false); 122 this.$store.commit("application/showUsermenu", false);
123 this.$store.commit("application/showSplitscreen", false); 123 this.$store.commit("application/showSplitscreen", false);
124 this.$router.push("/login"); 124 this.$router.push("/login");
125 }, 125 },
126 toggleContextBox(context) { 126 toggleContextBox(context) {
127 const SHOW = context;
128 const HIDE = null;
129 const isElementAlreadyShown = this.showInContextBox === context;
130 let toggleState =
131 isElementAlreadyShown && this.routeName === "mainview" ? HIDE : SHOW;
132 this.$router.push("/"); 127 this.$router.push("/");
133 this.$store.commit("application/showInContextBox", toggleState); 128 this.$store.commit("application/showContextBox", true);
134 if (this.showInContextBox === context) { 129 this.$store.commit("application/contextBoxContent", context);
135 this.$store.commit("application/showSearchbar", true); 130 this.$store.commit("application/showSearchbar", true);
136 } else {
137 this.$store.commit(
138 "application/showSearchbar",
139 this.showSearchbarLastState
140 );
141 }
142 } 131 }
143 } 132 }
144 }; 133 };
145 </script> 134 </script>
146 135