diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2018-10-01 17:21:03 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2018-10-01 17:23:06 +0200 |
commit | c5d04b4f3543bd1e5b07773b191f58c520edf205 (patch) | |
tree | 8612c68f08925f90a72de492a01934af628b887e /client/src/app/search/advanced-search.model.ts | |
parent | 99cc653f47a5db664ec119e66a84c8f6454eed0b (diff) | |
download | PeerTube-c5d04b4f3543bd1e5b07773b191f58c520edf205.tar.gz PeerTube-c5d04b4f3543bd1e5b07773b191f58c520edf205.tar.zst PeerTube-c5d04b4f3543bd1e5b07773b191f58c520edf205.zip |
add allow advancedSearch with empty search
a.k.a. filters on all videos
also added a badge showing the rough number of active filters
Diffstat (limited to 'client/src/app/search/advanced-search.model.ts')
-rw-r--r-- | client/src/app/search/advanced-search.model.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/client/src/app/search/advanced-search.model.ts b/client/src/app/search/advanced-search.model.ts index 48616a9ae..033fa9bba 100644 --- a/client/src/app/search/advanced-search.model.ts +++ b/client/src/app/search/advanced-search.model.ts | |||
@@ -110,6 +110,19 @@ export class AdvancedSearch { | |||
110 | } | 110 | } |
111 | } | 111 | } |
112 | 112 | ||
113 | size () { | ||
114 | let acc = 0 | ||
115 | |||
116 | const obj = this.toUrlObject() | ||
117 | for (const k of Object.keys(obj)) { | ||
118 | if (k === 'sort') continue // Exception | ||
119 | |||
120 | if (obj[k] !== undefined) acc++ | ||
121 | } | ||
122 | |||
123 | return acc | ||
124 | } | ||
125 | |||
113 | private intoArray (value: any) { | 126 | private intoArray (value: any) { |
114 | if (!value) return undefined | 127 | if (!value) return undefined |
115 | 128 | ||