diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-08-21 11:21:45 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-08-21 11:21:45 +0200 |
commit | 9aa46b0c7bade696a477626ad7590ffdd281e03c (patch) | |
tree | 9c12ff581c7b95ecc134d42bcb4a54ee4254ab95 /client/src/app/shared/search/search.component.ts | |
parent | e105c19c8ebe56b6828ba82948895ad0ca71d8c2 (diff) | |
download | PeerTube-9aa46b0c7bade696a477626ad7590ffdd281e03c.tar.gz PeerTube-9aa46b0c7bade696a477626ad7590ffdd281e03c.tar.zst PeerTube-9aa46b0c7bade696a477626ad7590ffdd281e03c.zip |
Client: navigate to /videos/list when do search on another page
Diffstat (limited to 'client/src/app/shared/search/search.component.ts')
-rw-r--r-- | client/src/app/shared/search/search.component.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/client/src/app/shared/search/search.component.ts b/client/src/app/shared/search/search.component.ts index 219997e85..853f5dc7c 100644 --- a/client/src/app/shared/search/search.component.ts +++ b/client/src/app/shared/search/search.component.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | import { Component, OnInit } from '@angular/core'; | 1 | import { Component, OnInit } from '@angular/core'; |
2 | import { Router } from '@angular/router'; | ||
2 | 3 | ||
3 | import { DROPDOWN_DIRECTIVES} from 'ng2-bootstrap/components/dropdown'; | 4 | import { DROPDOWN_DIRECTIVES} from 'ng2-bootstrap/components/dropdown'; |
4 | 5 | ||
@@ -25,7 +26,7 @@ export class SearchComponent implements OnInit { | |||
25 | value: '' | 26 | value: '' |
26 | }; | 27 | }; |
27 | 28 | ||
28 | constructor(private searchService: SearchService) {} | 29 | constructor(private searchService: SearchService, private router: Router) {} |
29 | 30 | ||
30 | ngOnInit() { | 31 | ngOnInit() { |
31 | // Subscribe if the search changed | 32 | // Subscribe if the search changed |
@@ -58,6 +59,10 @@ export class SearchComponent implements OnInit { | |||
58 | } | 59 | } |
59 | 60 | ||
60 | doSearch() { | 61 | doSearch() { |
62 | if (this.router.url.indexOf('/videos/list') === -1) { | ||
63 | this.router.navigate([ '/videos/list' ]); | ||
64 | } | ||
65 | |||
61 | this.searchService.searchUpdated.next(this.searchCriterias); | 66 | this.searchService.searchUpdated.next(this.searchCriterias); |
62 | } | 67 | } |
63 | 68 | ||