aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/header
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-02-17 10:27:00 +0100
committerChocobozzz <me@florianbigard.com>2020-02-17 10:27:00 +0100
commit4c1c17093461b58d3ee3f23f239e340d8dac1149 (patch)
tree236b724f1415a812a4274fd63b519124cba2e42f /client/src/app/header
parent45f1bd72a08998c60a9dd68ff069cea9de39161c (diff)
downloadPeerTube-4c1c17093461b58d3ee3f23f239e340d8dac1149.tar.gz
PeerTube-4c1c17093461b58d3ee3f23f239e340d8dac1149.tar.zst
PeerTube-4c1c17093461b58d3ee3f23f239e340d8dac1149.zip
Refactor email enabled function
Diffstat (limited to 'client/src/app/header')
-rw-r--r--client/src/app/header/search-typeahead.component.ts22
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 @@
1import { 1import { Component, ElementRef, OnDestroy, OnInit, QueryList, ViewChild } from '@angular/core'
2 Component, 2import { ActivatedRoute, Params, Router } from '@angular/router'
3 OnInit,
4 OnDestroy,
5 QueryList,
6 ViewChild,
7 ElementRef
8} from '@angular/core'
9import { Router, Params, ActivatedRoute } from '@angular/router'
10import { AuthService, ServerService } from '@app/core' 3import { AuthService, ServerService } from '@app/core'
11import { first, tap } from 'rxjs/operators' 4import { first, tap } from 'rxjs/operators'
12import { ListKeyManager } from '@angular/cdk/a11y' 5import { ListKeyManager } from '@angular/cdk/a11y'
13import { UP_ARROW, DOWN_ARROW, ENTER } from '@angular/cdk/keycodes' 6import { Result, SuggestionComponent } from './suggestion.component'
14import { SuggestionComponent, Result } from './suggestion.component'
15import { of } from 'rxjs' 7import { of } from 'rxjs'
16import { ServerConfig } from '@shared/models' 8import { 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