X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fbuttons%2Faction-dropdown.component.ts;h=a4200f70f7ad97417fa98967a0f8872178b96e4a;hb=223b24e618146f85b20b5bf365bc18d14a5964cd;hp=f5345831b86dd5827d28a11a14411347945ecdc1;hpb=3a0fb65c61f80b510bce979a45d59d17948745e8;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/buttons/action-dropdown.component.ts b/client/src/app/shared/buttons/action-dropdown.component.ts index f5345831b..a4200f70f 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.ts +++ b/client/src/app/shared/buttons/action-dropdown.component.ts @@ -38,13 +38,11 @@ export class ActionDropdownComponent { return [ this.actions ] } - areActionsDisplayed (actions: DropdownAction[], entry: T) { - return actions.some(a => a.isDisplayed === undefined || a.isDisplayed(entry)) - } - - handleClick (event: Event, action: DropdownAction) { - event.preventDefault() + areActionsDisplayed (actions: Array | DropdownAction[]>, entry: T): boolean { + return actions.some(a => { + if (Array.isArray(a)) return this.areActionsDisplayed(a, entry) - // action.handler(entry) + return a.isDisplayed === undefined || a.isDisplayed(entry) + }) } }