aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-06 11:07:30 +0100
committerChocobozzz <me@florianbigard.com>2019-12-06 11:07:30 +0100
commit3d216ea0f74cfa47312b97bae0e24885b563dd6d (patch)
tree9082c1a14f66039d5516f48521de02cdd2365dd0 /client/src/app/shared
parent941c5eac1751ef93500d6afa58c4575f777dbff9 (diff)
downloadPeerTube-3d216ea0f74cfa47312b97bae0e24885b563dd6d.tar.gz
PeerTube-3d216ea0f74cfa47312b97bae0e24885b563dd6d.tar.zst
PeerTube-3d216ea0f74cfa47312b97bae0e24885b563dd6d.zip
Fix dropdown on video miniature for unlogged users
Diffstat (limited to 'client/src/app/shared')
-rw-r--r--client/src/app/shared/buttons/action-dropdown.component.html2
-rw-r--r--client/src/app/shared/buttons/action-dropdown.component.ts8
2 files changed, 7 insertions, 3 deletions
diff --git a/client/src/app/shared/buttons/action-dropdown.component.html b/client/src/app/shared/buttons/action-dropdown.component.html
index cc244dc76..99e8b7ec1 100644
--- a/client/src/app/shared/buttons/action-dropdown.component.html
+++ b/client/src/app/shared/buttons/action-dropdown.component.html
@@ -1,4 +1,4 @@
1<div class="dropdown-root" ngbDropdown [placement]="placement"> 1<div class="dropdown-root" ngbDropdown [placement]="placement" *ngIf="areActionsDisplayed(actions, entry)">
2 <div 2 <div
3 class="action-button" [ngClass]="{ small: buttonSize === 'small', grey: theme === 'grey', orange: theme === 'orange', 'button-styled': buttonStyled }" 3 class="action-button" [ngClass]="{ small: buttonSize === 'small', grey: theme === 'grey', orange: theme === 'orange', 'button-styled': buttonStyled }"
4 ngbDropdownToggle role="button" 4 ngbDropdownToggle role="button"
diff --git a/client/src/app/shared/buttons/action-dropdown.component.ts b/client/src/app/shared/buttons/action-dropdown.component.ts
index c9dbbfda2..a4200f70f 100644
--- a/client/src/app/shared/buttons/action-dropdown.component.ts
+++ b/client/src/app/shared/buttons/action-dropdown.component.ts
@@ -38,7 +38,11 @@ export class ActionDropdownComponent<T> {
38 return [ this.actions ] 38 return [ this.actions ]
39 } 39 }
40 40
41 areActionsDisplayed (actions: DropdownAction<T>[], entry: T) { 41 areActionsDisplayed (actions: Array<DropdownAction<T> | DropdownAction<T>[]>, entry: T): boolean {
42 return actions.some(a => a.isDisplayed === undefined || a.isDisplayed(entry)) 42 return actions.some(a => {
43 if (Array.isArray(a)) return this.areActionsDisplayed(a, entry)
44
45 return a.isDisplayed === undefined || a.isDisplayed(entry)
46 })
43 } 47 }
44} 48}