X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Frest%2Frest-table.ts;h=d4e6cf5f2c877b78701895429f2f06098860f3d1;hb=25a42e293be90d35afad2096e9db2fa3d617d855;hp=4dd0f5ff30d4eb71816baf2678ce4e5c97d7db4e;hpb=801d957155d574bda984206021cdd1fe58ef56b9;p=github%2FChocobozzz%2FPeerTube.git 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 { this.searchStream.next(target.value) } - onPage () { + onPage (event: { first: number, rows: number }) { + if (this.rowsPerPage !== event.rows) { + this.rowsPerPage = event.rows + this.pagination = { + start: event.first, + count: this.rowsPerPage + } + this.loadData() + } this.expandedRows = {} } + setTableFilter (filter: string) { + // FIXME: cannot use ViewChild, so create a component for the filter input + const filterInput = document.getElementById('table-filter') as HTMLInputElement + if (filterInput) filterInput.value = filter + } + + resetSearch () { + this.searchStream.next('') + this.setTableFilter('') + } + protected abstract loadData (): void private getSortLocalStorageKey () {