diff options
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 | ||