aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/search/search.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/search/search.component.ts')
-rw-r--r--client/src/app/search/search.component.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/client/src/app/search/search.component.ts b/client/src/app/search/search.component.ts
index 475fdd277..b86b5083a 100644
--- a/client/src/app/search/search.component.ts
+++ b/client/src/app/search/search.component.ts
@@ -30,7 +30,7 @@ export class SearchComponent implements OnInit, OnDestroy {
30 currentSearch: string 30 currentSearch: string
31 31
32 private subActivatedRoute: Subscription 32 private subActivatedRoute: Subscription
33 private isInitialLoad = true 33 private isInitialLoad = false // set to false to show the search filters on first arrival
34 private firstSearch = true 34 private firstSearch = true
35 35
36 private channelsPerPage = 2 36 private channelsPerPage = 2
@@ -137,6 +137,10 @@ export class SearchComponent implements OnInit, OnDestroy {
137 this.updateUrlFromAdvancedSearch() 137 this.updateUrlFromAdvancedSearch()
138 } 138 }
139 139
140 numberOfFilters () {
141 return this.advancedSearch.size()
142 }
143
140 private resetPagination () { 144 private resetPagination () {
141 this.pagination.currentPage = 1 145 this.pagination.currentPage = 1
142 this.pagination.totalItems = null 146 this.pagination.totalItems = null
@@ -150,9 +154,11 @@ export class SearchComponent implements OnInit, OnDestroy {
150 } 154 }
151 155
152 private updateUrlFromAdvancedSearch () { 156 private updateUrlFromAdvancedSearch () {
157 const search = (this.currentSearch && this.currentSearch !== '') ? this.currentSearch : undefined
158
153 this.router.navigate([], { 159 this.router.navigate([], {
154 relativeTo: this.route, 160 relativeTo: this.route,
155 queryParams: Object.assign({}, this.advancedSearch.toUrlObject(), { search: this.currentSearch }) 161 queryParams: Object.assign({}, this.advancedSearch.toUrlObject(), { search })
156 }) 162 })
157 } 163 }
158} 164}