]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/buttons/action-dropdown.component.ts
Fix upnext, refactor avatar menu, add to playlist overflow
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / buttons / action-dropdown.component.ts
index f5345831b86dd5827d28a11a14411347945ecdc1..a4200f70f7ad97417fa98967a0f8872178b96e4a 100644 (file)
@@ -38,13 +38,11 @@ export class ActionDropdownComponent<T> {
     return [ this.actions ]
   }
 
-  areActionsDisplayed (actions: DropdownAction<T>[], entry: T) {
-    return actions.some(a => a.isDisplayed === undefined || a.isDisplayed(entry))
-  }
-
-  handleClick (event: Event, action: DropdownAction<T>) {
-    event.preventDefault()
+  areActionsDisplayed (actions: Array<DropdownAction<T> | DropdownAction<T>[]>, 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)
+    })
   }
 }