-<!--
-TODO focus search input
--->
-<div id='staffcat-search-form' class="row pt-3 pb-3 mb-3">
+<div id='staffcat-search-form'>
+
+ <div *ngIf="!showThyself" class="row pt-1 pb-1 mb-2 pr-2">
+ <div class="col-lg-12 d-flex">
+ <div class="flex-1"></div><!-- push right -->
+ <a (click)="showThyself=true" class="label-with-material-icon no-href" i18n>
+ Show Search Form <span class="material-icons">unfold_more</span>
+ </a>
+ </div>
+ </div>
+
+ <div *ngIf="showThyself" class="row pt-3 pb-3 mb-3">
<div class="col-lg-8">
<ngb-tabset #searchTabs [activeId]="searchTab" (tabChange)="onTabChange($event)">
<ngb-tab title="Keyword Search" i18n-title id="term">
</div>
</div>
</div>
+ </div>
</div>
import {Component, OnInit, AfterViewInit, Renderer2} from '@angular/core';
-import {ActivatedRoute} from '@angular/router';
+import {Router, ActivatedRoute, NavigationEnd} from '@angular/router';
import {IdlObject} from '@eg/core/idl.service';
import {OrgService} from '@eg/core/org.service';
import {CatalogService} from '@eg/share/catalog/catalog.service';
copyLocations: IdlObject[];
searchTab: string;
+ // Display the full form if true, otherwise display the expandy.
+ showThyself = true;
+
constructor(
private renderer: Renderer2,
+ private router: Router,
private route: ActivatedRoute,
private org: OrgService,
private cat: CatalogService,
this.searchTab = params.searchTab;
}
});
+
+ this.router.events.subscribe(routeEvent => {
+ if (routeEvent instanceof NavigationEnd) {
+ if (routeEvent.url.match(/catalog\/record/)) {
+ this.showThyself = false;
+ } else {
+ this.showThyself = true;
+ }
+ }
+ });
}
ngOnInit() {