diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-07-18 15:39:10 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-07-18 15:39:10 +0200 |
commit | bddab65ae58e347693b777cccf791201fdbcff4d (patch) | |
tree | 9d3c35c8ab9ef7bfb99ebe95b79c5309a7025112 /client/src/app/shared/search/search.component.ts | |
parent | 0629423ce335137ce77d1ee8fe30fc0eee36d83b (diff) | |
download | PeerTube-bddab65ae58e347693b777cccf791201fdbcff4d.tar.gz PeerTube-bddab65ae58e347693b777cccf791201fdbcff4d.tar.zst PeerTube-bddab65ae58e347693b777cccf791201fdbcff4d.zip |
Client: save page params as well
Diffstat (limited to 'client/src/app/shared/search/search.component.ts')
-rw-r--r-- | client/src/app/shared/search/search.component.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/client/src/app/shared/search/search.component.ts b/client/src/app/shared/search/search.component.ts index d33701bc8..e864fbc17 100644 --- a/client/src/app/shared/search/search.component.ts +++ b/client/src/app/shared/search/search.component.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { Component, EventEmitter, Output, OnInit } from '@angular/core'; | 1 | import { Component, OnInit } from '@angular/core'; |
2 | 2 | ||
3 | import { DROPDOWN_DIRECTIVES} from 'ng2-bootstrap/components/dropdown'; | 3 | import { DROPDOWN_DIRECTIVES} from 'ng2-bootstrap/components/dropdown'; |
4 | 4 | ||
@@ -13,8 +13,6 @@ import { SearchService } from './search.service'; | |||
13 | }) | 13 | }) |
14 | 14 | ||
15 | export class SearchComponent implements OnInit { | 15 | export class SearchComponent implements OnInit { |
16 | @Output() search = new EventEmitter<Search>(); | ||
17 | |||
18 | fieldChoices = { | 16 | fieldChoices = { |
19 | name: 'Name', | 17 | name: 'Name', |
20 | author: 'Author', | 18 | author: 'Author', |
@@ -30,7 +28,9 @@ export class SearchComponent implements OnInit { | |||
30 | constructor(private searchService: SearchService) {} | 28 | constructor(private searchService: SearchService) {} |
31 | 29 | ||
32 | ngOnInit() { | 30 | ngOnInit() { |
33 | this.searchService.searchChanged.subscribe( | 31 | // Subscribe is the search changed |
32 | // Usually changed by videos list component | ||
33 | this.searchService.updateSearch.subscribe( | ||
34 | newSearchCriterias => { | 34 | newSearchCriterias => { |
35 | // Put a field by default | 35 | // Put a field by default |
36 | if (!newSearchCriterias.field) { | 36 | if (!newSearchCriterias.field) { |
@@ -58,7 +58,7 @@ export class SearchComponent implements OnInit { | |||
58 | } | 58 | } |
59 | 59 | ||
60 | doSearch() { | 60 | doSearch() { |
61 | this.search.emit(this.searchCriterias); | 61 | this.searchService.searchUpdated.next(this.searchCriterias); |
62 | } | 62 | } |
63 | 63 | ||
64 | getStringChoice(choiceKey: SearchField) { | 64 | getStringChoice(choiceKey: SearchField) { |