1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Add video filters to common video pages

This commit is contained in:
Chocobozzz 2021-08-19 09:24:29 +02:00
parent 2e80d256cc
commit dd24f1bb0a
No known key found for this signature in database
GPG key ID: 583A612D890159BE
97 changed files with 2610 additions and 1896 deletions

View file

@ -2,7 +2,7 @@ import { Component, forwardRef, Input, OnInit } from '@angular/core'
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
import { SelectOptionsItem } from '../../../../types/select-options-item.model'
export type ItemSelectCheckboxValue = { id?: string | number, group?: string } | string
export type ItemSelectCheckboxValue = { id?: string, group?: string } | string
@Component({
selector: 'my-select-checkbox',
@ -21,7 +21,6 @@ export class SelectCheckboxComponent implements OnInit, ControlValueAccessor {
@Input() selectedItems: ItemSelectCheckboxValue[] = []
@Input() selectableGroup: boolean
@Input() selectableGroupAsModel: boolean
@Input() maxSelectedItems: number
@Input() placeholder: string
ngOnInit () {
@ -46,8 +45,6 @@ export class SelectCheckboxComponent implements OnInit, ControlValueAccessor {
} else {
this.selectedItems = items
}
this.propagateChange(this.selectedItems)
}
registerOnChange (fn: (_: any) => void) {
@ -63,7 +60,7 @@ export class SelectCheckboxComponent implements OnInit, ControlValueAccessor {
}
compareFn (item: SelectOptionsItem, selected: ItemSelectCheckboxValue) {
if (typeof selected === 'string') {
if (typeof selected === 'string' || typeof selected === 'number') {
return item.id === selected
}