Fix admin table filters
This commit is contained in:
parent
ac2b052d54
commit
3f6441e09a
|
@ -108,7 +108,7 @@ export class VideoBlockListComponent extends RestTable implements OnInit, AfterV
|
|||
}
|
||||
|
||||
ngAfterViewInit () {
|
||||
if (this.search) this.setTableFilter(this.search)
|
||||
if (this.search) this.setTableFilter(this.search, false)
|
||||
}
|
||||
|
||||
/* Table filter functions */
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
|
||||
<ng-template pTemplate="emptymessage">
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<td colspan="7">
|
||||
<div class="no-results">
|
||||
<ng-container *ngIf="search" i18n>No comments found matching current filters.</ng-container>
|
||||
<ng-container *ngIf="!search" i18n>No comments found.</ng-container>
|
||||
|
|
|
@ -92,7 +92,7 @@ export class VideoCommentListComponent extends RestTable implements OnInit, Afte
|
|||
}
|
||||
|
||||
ngAfterViewInit () {
|
||||
if (this.search) this.setTableFilter(this.search)
|
||||
if (this.search) this.setTableFilter(this.search, false)
|
||||
}
|
||||
|
||||
getIdentifier () {
|
||||
|
|
|
@ -131,10 +131,14 @@ export abstract class RestTable {
|
|||
this.expandedRows = {}
|
||||
}
|
||||
|
||||
setTableFilter (filter: string) {
|
||||
setTableFilter (filter: string, triggerEvent = true) {
|
||||
// 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
|
||||
if (!filterInput) return
|
||||
|
||||
filterInput.value = filter
|
||||
|
||||
if (triggerEvent) filterInput.dispatchEvent(new Event('keyup'))
|
||||
}
|
||||
|
||||
resetSearch () {
|
||||
|
|
|
@ -70,7 +70,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV
|
|||
}
|
||||
|
||||
ngAfterViewInit () {
|
||||
if (this.search) this.setTableFilter(this.search)
|
||||
if (this.search) this.setTableFilter(this.search, false)
|
||||
}
|
||||
|
||||
isAdminView () {
|
||||
|
|
Loading…
Reference in New Issue