Added functionality where the filter box is removed if visible when org unit is selected
authorYrjan A. F. Fraschetti <yrjanaff@1x-193-157-250-45.uio.no>
Thu, 10 Dec 2015 18:05:35 +0000 (19:05 +0100)
committerYrjan A. F. Fraschetti <yrjanaff@1x-193-157-250-45.uio.no>
Thu, 10 Dec 2015 18:05:35 +0000 (19:05 +0100)
src/components/search/search.html
src/components/search/search.ts

index 93ebcea..3ca52b0 100644 (file)
@@ -26,7 +26,7 @@
         </div>
     </form>
 
-    <!-- Searchresult data-toggle="collapse" data-target="#dropdown-menu"-->
+    <!-- Searchresult -->
     <div class="row">
         <span [hidden]="hideDiv()">
             <div class="divresult col-md-10" id="divresult" [hidden]="checkOrgunits()">
index b68786e..03100fa 100644 (file)
@@ -39,6 +39,11 @@ export class Search {
     getMoreInfo(orgunit) {
         this.orgunits = [];
         this.newsearch.next(orgunit.id);
+        if(!this.visible){
+            this.visible = !this.visible;
+            this.resetSelector();
+            document.getElementById("dropdown-menu").style.display = "none";
+        }
         return document.getElementById("searchform").reset();
 
     }
@@ -66,7 +71,6 @@ export class Search {
     //Hide results when search bar input is erased
     hideDiv() {
         if (this.searchBar.value == ""){
-            //this.toggle();
             return true;
         }
     }