diff client/src/application/Search.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 315e618a29fd
line wrap: on
line diff
--- a/client/src/application/Search.vue	Tue Nov 20 00:51:33 2018 +0100
+++ b/client/src/application/Search.vue	Tue Nov 20 08:47:53 2018 +0100
@@ -14,7 +14,7 @@
                 type="text"
                 :class="searchInputStyle"
             >
-            <ul v-if="showSearchbar && searchResults !== null && !showBottlenecks" class="list-group d-print-none">
+            <ul v-if="showSearchbar && searchResults !== null && !showInContextBox" class="list-group d-print-none">
                 <li v-for="entry of searchResults" :key="entry.name" class="list-group-item">
                     <a href="#" @click.prevent="moveToSearchResult(entry)">{{entry.name}}</a>
                 </li>
@@ -92,11 +92,7 @@
     };
   },
   computed: {
-    ...mapState("application", [
-      "showSearchbar",
-      "showBottlenecks",
-      "showImportSoundingResults"
-    ]),
+    ...mapState("application", ["showSearchbar", "showInContextBox"]),
     searchQuery: {
       get() {
         return this.$store.state.application.searchQuery;
@@ -120,15 +116,15 @@
         {
           "searchbar-collapsed": !this.showSearchbar,
           "searchbar-expanded": this.showSearchbar,
-          "d-flex": !this.showImportSoundingResults,
-          "d-none": this.showImportSoundingResults
+          "d-flex": this.showInContextBox !== "imports",
+          "d-none": this.showInContextBox === "imports"
         }
       ];
     },
     searchInputStyle() {
       return [
         "form-control ui-element search searchbar d-print-none border-0",
-        { "rounded-top-right": this.showSearchbar && this.showBottlenecks }
+        { "rounded-top-right": this.showInContextBox }
       ];
     },
     searchButtonStyle() {
@@ -137,7 +133,7 @@
         {
           rounded: !this.showSearchbar,
           "rounded-left": this.showSearchbar,
-          "rounded-top-left": this.showSearchbar && this.showBottlenecks
+          "rounded-top-left": this.showSearchbar && this.showInContextBox
         }
       ];
     }
@@ -207,7 +203,7 @@
       this.toggleSearchbar();
     },
     toggleSearchbar() {
-      if (!this.showBottlenecks) {
+      if (!this.showInContextBox) {
         if (!this.showSearchbar) {
           setTimeout(setFocus, 300);
         }