aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/rest/rest-table.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-05-03 23:01:57 +0200
committerRigel Kent <par@rigelk.eu>2020-05-04 15:01:44 +0200
commit25a42e293be90d35afad2096e9db2fa3d617d855 (patch)
tree5739da8e2aed75447cf0fd608089cc8849c0da33 /client/src/app/shared/rest/rest-table.ts
parent801d957155d574bda984206021cdd1fe58ef56b9 (diff)
downloadPeerTube-25a42e293be90d35afad2096e9db2fa3d617d855.tar.gz
PeerTube-25a42e293be90d35afad2096e9db2fa3d617d855.tar.zst
PeerTube-25a42e293be90d35afad2096e9db2fa3d617d855.zip
Fix rowsPerPage change, add filter clear button, update video-abuse-list search query param dynamically
Diffstat (limited to 'client/src/app/shared/rest/rest-table.ts')
-rw-r--r--client/src/app/shared/rest/rest-table.ts21
1 files changed, 20 insertions, 1 deletions
diff --git a/client/src/app/shared/rest/rest-table.ts b/client/src/app/shared/rest/rest-table.ts
index 4dd0f5ff3..d4e6cf5f2 100644
--- a/client/src/app/shared/rest/rest-table.ts
+++ b/client/src/app/shared/rest/rest-table.ts
@@ -74,10 +74,29 @@ export abstract class RestTable {
74 this.searchStream.next(target.value) 74 this.searchStream.next(target.value)
75 } 75 }
76 76
77 onPage () { 77 onPage (event: { first: number, rows: number }) {
78 if (this.rowsPerPage !== event.rows) {
79 this.rowsPerPage = event.rows
80 this.pagination = {
81 start: event.first,
82 count: this.rowsPerPage
83 }
84 this.loadData()
85 }
78 this.expandedRows = {} 86 this.expandedRows = {}
79 } 87 }
80 88
89 setTableFilter (filter: string) {
90 // FIXME: cannot use ViewChild, so create a component for the filter input
91 const filterInput = document.getElementById('table-filter') as HTMLInputElement
92 if (filterInput) filterInput.value = filter
93 }
94
95 resetSearch () {
96 this.searchStream.next('')
97 this.setTableFilter('')
98 }
99
81 protected abstract loadData (): void 100 protected abstract loadData (): void
82 101
83 private getSortLocalStorageKey () { 102 private getSortLocalStorageKey () {