diff options
Diffstat (limited to 'client/src/app/shared/search/search.component.ts')
-rw-r--r-- | client/src/app/shared/search/search.component.ts | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/client/src/app/shared/search/search.component.ts b/client/src/app/shared/search/search.component.ts index ecce20666..6e2827fe3 100644 --- a/client/src/app/shared/search/search.component.ts +++ b/client/src/app/shared/search/search.component.ts | |||
@@ -16,10 +16,9 @@ export class SearchComponent implements OnInit { | |||
16 | name: 'Name', | 16 | name: 'Name', |
17 | author: 'Author', | 17 | author: 'Author', |
18 | host: 'Pod Host', | 18 | host: 'Pod Host', |
19 | magnetUri: 'Magnet URI', | ||
20 | tags: 'Tags' | 19 | tags: 'Tags' |
21 | } | 20 | } |
22 | searchCriterias: Search = { | 21 | searchCriteria: Search = { |
23 | field: 'name', | 22 | field: 'name', |
24 | value: '' | 23 | value: '' |
25 | } | 24 | } |
@@ -30,13 +29,13 @@ export class SearchComponent implements OnInit { | |||
30 | // Subscribe if the search changed | 29 | // Subscribe if the search changed |
31 | // Usually changed by videos list component | 30 | // Usually changed by videos list component |
32 | this.searchService.updateSearch.subscribe( | 31 | this.searchService.updateSearch.subscribe( |
33 | newSearchCriterias => { | 32 | newSearchCriteria => { |
34 | // Put a field by default | 33 | // Put a field by default |
35 | if (!newSearchCriterias.field) { | 34 | if (!newSearchCriteria.field) { |
36 | newSearchCriterias.field = 'name' | 35 | newSearchCriteria.field = 'name' |
37 | } | 36 | } |
38 | 37 | ||
39 | this.searchCriterias = newSearchCriterias | 38 | this.searchCriteria = newSearchCriteria |
40 | } | 39 | } |
41 | ) | 40 | ) |
42 | } | 41 | } |
@@ -49,9 +48,9 @@ export class SearchComponent implements OnInit { | |||
49 | $event.preventDefault() | 48 | $event.preventDefault() |
50 | $event.stopPropagation() | 49 | $event.stopPropagation() |
51 | 50 | ||
52 | this.searchCriterias.field = choice | 51 | this.searchCriteria.field = choice |
53 | 52 | ||
54 | if (this.searchCriterias.value) { | 53 | if (this.searchCriteria.value) { |
55 | this.doSearch() | 54 | this.doSearch() |
56 | } | 55 | } |
57 | } | 56 | } |
@@ -61,7 +60,7 @@ export class SearchComponent implements OnInit { | |||
61 | this.router.navigate([ '/videos/list' ]) | 60 | this.router.navigate([ '/videos/list' ]) |
62 | } | 61 | } |
63 | 62 | ||
64 | this.searchService.searchUpdated.next(this.searchCriterias) | 63 | this.searchService.searchUpdated.next(this.searchCriteria) |
65 | } | 64 | } |
66 | 65 | ||
67 | getStringChoice (choiceKey: SearchField) { | 66 | getStringChoice (choiceKey: SearchField) { |