Don't display divider on empty block
This commit is contained in:
parent
990266f149
commit
4302802840
|
@ -13,7 +13,7 @@
|
|||
<ng-container *ngFor="let actions of getActions()">
|
||||
|
||||
<ng-container *ngFor="let action of actions">
|
||||
<div [ngClass]="action.class" *ngIf="action.isDisplayed === undefined || action.isDisplayed(entry) === true">
|
||||
<div [ngClass]="action.class" *ngIf="isBlockDisplayed(actions, action, entry)">
|
||||
|
||||
<ng-template #templateActionLabel let-action>
|
||||
<my-global-icon *ngIf="action.iconName" [iconName]="action.iconName" [ngClass]="'icon-' + action.iconName" aria-hidden="true"></my-global-icon>
|
||||
|
|
|
@ -80,4 +80,11 @@ export class ActionDropdownComponent<T> {
|
|||
return a.isHeader !== true && (a.isDisplayed === undefined || a.isDisplayed(entry))
|
||||
})
|
||||
}
|
||||
|
||||
isBlockDisplayed (allActions: (DropdownAction<T> | DropdownAction<T>[])[], action: DropdownAction<T>, entry: T) {
|
||||
// Do not display only the header
|
||||
if (action.isHeader && !this.areActionsDisplayed(allActions, entry)) return false
|
||||
|
||||
return action.isDisplayed === undefined || action.isDisplayed(entry) === true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue