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:
parent
2e80d256cc
commit
dd24f1bb0a
97 changed files with 2610 additions and 1896 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue