add expanded to control visibility of the search form
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 22 Jan 2020 22:49:05 +0000 (17:49 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 22 Jan 2020 22:49:05 +0000 (17:49 -0500)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.html
Open-ILS/src/eg2/src/app/staff/acq/search/acq-search-form.component.ts

index c375352..4450117 100644 (file)
@@ -8,8 +8,21 @@
     </select>
     of the following terms:</label>
   </div>
+  <div class="col-lg-6"></div>
+  <div class="col-lg-1">
+    <a class="with-material-icon no-href text-primary"
+      title="Show Form" i18n-title
+      *ngIf="!showForm" (click)="showForm=true">
+      <span class="material-icons">expand_more</span>
+    </a>
+    <a class="with-material-icon no-href text-primary"
+      title="Hide Form" i18n-title
+      *ngIf="showForm" (click)="showForm=false">
+      <span class="material-icons">expand_less</span>
+    </a>
+  </div>
 </div>
-<div class="row mb-1" *ngFor="let t of searchTerms; let idx=index">
+<div class="row mb-1" *ngFor="let t of searchTerms; let idx=index" [hidden]="!showForm">
   <div class="col-lg-3">
     <select class="form-control" id="selected-search-term" [ngModelOptions]="{standalone: true}" [(ngModel)]="t.field"
       (change)="clearSearchTerm(t)">
@@ -81,7 +94,7 @@
     </button>
   </div>
 </div>
-<div class="row">
+<div class="row" [hidden]="!showForm">
   <div class="col-lg-2">
     <button class="form-control btn btn-success" (click)="submitSearch()" i18n>Search</button>
   </div>
index 1c2474b..cc7d08e 100644 (file)
@@ -20,6 +20,8 @@ export class AcqSearchFormComponent implements OnInit, AfterViewInit {
 
     @Output() searchSubmitted = new EventEmitter<AcqSearch>();
 
+    showForm = true;
+
     hints = ['jub', 'acqpl', 'acqpo', 'acqinv', 'acqlid'];
     availableSearchFields = {};
     searchTermDatatypes = {};