diff options
Diffstat (limited to 'client/src/app/header')
-rw-r--r-- | client/src/app/header/search-typeahead.component.ts | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/client/src/app/header/search-typeahead.component.ts b/client/src/app/header/search-typeahead.component.ts index 210a1474c..372601fa8 100644 --- a/client/src/app/header/search-typeahead.component.ts +++ b/client/src/app/header/search-typeahead.component.ts | |||
@@ -1,17 +1,9 @@ | |||
1 | import { | 1 | import { Component, ElementRef, OnDestroy, OnInit, QueryList, ViewChild } from '@angular/core' |
2 | Component, | 2 | import { ActivatedRoute, Params, Router } from '@angular/router' |
3 | OnInit, | ||
4 | OnDestroy, | ||
5 | QueryList, | ||
6 | ViewChild, | ||
7 | ElementRef | ||
8 | } from '@angular/core' | ||
9 | import { Router, Params, ActivatedRoute } from '@angular/router' | ||
10 | import { AuthService, ServerService } from '@app/core' | 3 | import { AuthService, ServerService } from '@app/core' |
11 | import { first, tap } from 'rxjs/operators' | 4 | import { first, tap } from 'rxjs/operators' |
12 | import { ListKeyManager } from '@angular/cdk/a11y' | 5 | import { ListKeyManager } from '@angular/cdk/a11y' |
13 | import { UP_ARROW, DOWN_ARROW, ENTER } from '@angular/cdk/keycodes' | 6 | import { Result, SuggestionComponent } from './suggestion.component' |
14 | import { SuggestionComponent, Result } from './suggestion.component' | ||
15 | import { of } from 'rxjs' | 7 | import { of } from 'rxjs' |
16 | import { ServerConfig } from '@shared/models' | 8 | import { ServerConfig } from '@shared/models' |
17 | 9 | ||
@@ -145,13 +137,13 @@ export class SearchTypeaheadComponent implements OnInit, OnDestroy { | |||
145 | handleKeyUp (event: KeyboardEvent) { | 137 | handleKeyUp (event: KeyboardEvent) { |
146 | event.stopImmediatePropagation() | 138 | event.stopImmediatePropagation() |
147 | if (!this.keyboardEventsManager) return | 139 | if (!this.keyboardEventsManager) return |
148 | 140 | ||
149 | switch (event.key) { | 141 | switch (event.key) { |
150 | case "ArrowDown": | 142 | case 'ArrowDown': |
151 | case "ArrowUp": | 143 | case 'ArrowUp': |
152 | this.keyboardEventsManager.onKeydown(event) | 144 | this.keyboardEventsManager.onKeydown(event) |
153 | break | 145 | break |
154 | case "Enter": | 146 | case 'Enter': |
155 | this.newSearch = false | 147 | this.newSearch = false |
156 | this.doSearch() | 148 | this.doSearch() |
157 | break | 149 | break |