diff options
Diffstat (limited to 'client/src/app/shared/buttons')
-rw-r--r-- | client/src/app/shared/buttons/action-dropdown.component.html | 2 | ||||
-rw-r--r-- | client/src/app/shared/buttons/action-dropdown.component.ts | 8 |
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 | } |