comparison client/src/application/Sidebar.vue @ 1230:957907eaaa72

implemented context sensitive box below search bar (see: issue224)
author Markus Kottlaender <markus@intevation.de>
date Tue, 20 Nov 2018 08:47:53 +0100
parents ba8cd80d68b6
children 1a5564655f2a
comparison
equal deleted inserted replaced
1229:d395b2940a82 1230:957907eaaa72
15 <i class="fa fa-ship align-self-center navicon"></i> 15 <i class="fa fa-ship align-self-center navicon"></i>
16 <a 16 <a
17 class="text-body d-flex flex-row" 17 class="text-body d-flex flex-row"
18 v-if="routeName == 'mainview'" 18 v-if="routeName == 'mainview'"
19 href="#" 19 href="#"
20 @click="toggleBottlenecks" 20 @click="toggleContextBox('bottlenecks')"
21 >Bottlenecks</a> 21 >Bottlenecks</a>
22 </div> 22 </div>
23 <div v-if="isSysAdmin"> 23 <div v-if="isSysAdmin">
24 <hr> 24 <hr>
25 <div class="nav-link d-flex menupadding text-muted">Administration</div> 25 <div class="nav-link d-flex menupadding text-muted">Administration</div>
28 <div v-if="routeName == 'mainview'" class="d-flex flex-row nav-link"> 28 <div v-if="routeName == 'mainview'" class="d-flex flex-row nav-link">
29 <i class="fa fa-upload align-self-center navicon"></i> 29 <i class="fa fa-upload align-self-center navicon"></i>
30 <a 30 <a
31 href="#" 31 href="#"
32 class="text-body" 32 class="text-body"
33 @click="toggleImportSoundingResults" 33 @click="toggleContextBox('imports')"
34 >Import soundingresults</a> 34 >Import soundingresults</a>
35 </div> 35 </div>
36 <div v-if="routeName == 'mainview'" class="d-flex flex-row nav-link"> 36 <div v-if="routeName == 'mainview'" class="d-flex flex-row nav-link">
37 <i class="fa fa-list-ol align-self-center navicon"></i> 37 <i class="fa fa-list-ol align-self-center navicon"></i>
38 <a 38 <a
39 href="#" 39 href="#"
40 class="text-body" 40 class="text-body"
41 @click="$store.commit('application/showStagingArea', !showStagingArea);" 41 @click="toggleContextBox('staging')"
42 >Staging area</a> 42 >Staging area</a>
43 </div> 43 </div>
44 <router-link class="text-body d-flex flex-row nav-link" to="usermanagement"> 44 <router-link class="text-body d-flex flex-row nav-link" to="usermanagement">
45 <i class="fa fa-address-card-o align-self-center navicon"></i>Users 45 <i class="fa fa-address-card-o align-self-center navicon"></i>Users
46 </router-link> 46 </router-link>
94 computed: { 94 computed: {
95 ...mapGetters("user", ["isSysAdmin", "isWaterwayAdmin"]), 95 ...mapGetters("user", ["isSysAdmin", "isWaterwayAdmin"]),
96 ...mapState("user", ["user"]), 96 ...mapState("user", ["user"]),
97 ...mapState("application", [ 97 ...mapState("application", [
98 "showSidebar", 98 "showSidebar",
99 "showBottlenecks", 99 "showSearchbarLastState",
100 "showImportSoundingResults", 100 "showInContextBox"
101 "showStagingArea",
102 "showSearchbarLastState"
103 ]), 101 ]),
104 menuStyle() { 102 menuStyle() {
105 return { 103 return {
106 menu: true, 104 menu: true,
107 nav: true, 105 nav: true,
124 this.$store.commit("application/showSidebar", false); 122 this.$store.commit("application/showSidebar", false);
125 this.$store.commit("application/showUsermenu", false); 123 this.$store.commit("application/showUsermenu", false);
126 this.$store.commit("application/showSplitscreen", false); 124 this.$store.commit("application/showSplitscreen", false);
127 this.$router.push("/login"); 125 this.$router.push("/login");
128 }, 126 },
129 toggleBottlenecks() { 127 toggleContextBox(context) {
130 this.$store.commit("application/showBottlenecks", !this.showBottlenecks); 128 this.$store.commit(
131 this.$store.commit("application/showImportSoundingResults", false); 129 "application/showInContextBox",
132 if (this.showBottlenecks) { 130 this.showInContextBox === context ? null : context
131 );
132 if (this.showInContextBox === context) {
133 this.$store.commit("application/showSearchbar", true); 133 this.$store.commit("application/showSearchbar", true);
134 } else { 134 } else {
135 this.$store.commit( 135 this.$store.commit(
136 "application/showSearchbar", 136 "application/showSearchbar",
137 this.showSearchbarLastState 137 this.showSearchbarLastState
138 ); 138 );
139 } 139 }
140 },
141 toggleImportSoundingResults() {
142 this.$store.commit(
143 "application/showImportSoundingResults",
144 !this.showImportSoundingResults
145 );
146 this.$store.commit("application/showBottlenecks", false);
147 } 140 }
148 } 141 }
149 }; 142 };
150 </script> 143 </script>
151 144