]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/splash.component.ts
LP1615805 No inputs after submit in patron search (AngularJS)
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / splash.component.ts
1 import {Component, OnInit, Renderer2} from '@angular/core';
2 import {Router} from '@angular/router';
3
4 @Component({
5     templateUrl: 'splash.component.html'
6 })
7
8 export class StaffSplashComponent implements OnInit {
9
10     catSearchQuery: string;
11
12     constructor(
13         private renderer: Renderer2,
14         private router: Router
15     ) {}
16
17     ngOnInit() {
18
19         // Focus catalog search form
20         this.renderer.selectRootElement('#catalog-search-input').focus();
21     }
22
23     searchCatalog(): void {
24         if (!this.catSearchQuery) { return; }
25
26         this.router.navigate(
27             ['/staff/catalog/search'],
28             {queryParams: {query : this.catSearchQuery}}
29         );
30     }
31 }
32
33