mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
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 () {
|
ngAfterViewInit () {
|
||||||
if (this.search) this.setTableFilter(this.search)
|
if (this.search) this.setTableFilter(this.search, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Table filter functions */
|
/* Table filter functions */
|
||||||
|
@ -123,7 +123,7 @@
|
|||||||
|
|
||||||
<ng-template pTemplate="emptymessage">
|
<ng-template pTemplate="emptymessage">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="5">
|
<td colspan="7">
|
||||||
<div class="no-results">
|
<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 matching current filters.</ng-container>
|
||||||
<ng-container *ngIf="!search" i18n>No comments found.</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 () {
|
ngAfterViewInit () {
|
||||||
if (this.search) this.setTableFilter(this.search)
|
if (this.search) this.setTableFilter(this.search, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
getIdentifier () {
|
getIdentifier () {
|
||||||
|
@ -131,10 +131,14 @@ export abstract class RestTable {
|
|||||||
this.expandedRows = {}
|
this.expandedRows = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
setTableFilter (filter: string) {
|
setTableFilter (filter: string, triggerEvent = true) {
|
||||||
// FIXME: cannot use ViewChild, so create a component for the filter input
|
// FIXME: cannot use ViewChild, so create a component for the filter input
|
||||||
const filterInput = document.getElementById('table-filter') as HTMLInputElement
|
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 () {
|
resetSearch () {
|
||||||
|
@ -70,7 +70,7 @@ export class AbuseListTableComponent extends RestTable implements OnInit, AfterV
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewInit () {
|
ngAfterViewInit () {
|
||||||
if (this.search) this.setTableFilter(this.search)
|
if (this.search) this.setTableFilter(this.search, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
isAdminView () {
|
isAdminView () {
|
||||||
|
Loading…
Reference in New Issue
Block a user