aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/buttons/action-dropdown.component.html
blob: c87ba4c82f8b3d4a84b692a562b189bc28b7ffc1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<div class="dropdown-root" dropdown container="body" dropup="true" placement="right" role="button">
  <div class="action-button" dropdownToggle>
    <span class="icon icon-action"></span>
  </div>

  <ul *dropdownMenu class="dropdown-menu" id="more-menu" role="menu" aria-labelledby="single-button">
    <li role="menuitem" *ngFor="let action of actions">
      <my-delete-button *ngIf="action.type === 'delete'" [label]="action.label" (click)="action.handler(entry)"></my-delete-button>
      <my-edit-button *ngIf="action.type === 'edit'" [label]="action.label" [routerLink]="action.linkBuilder(entry)"></my-edit-button>

      <a *ngIf="action.type === 'custom'" class="dropdown-item" href="#" (click)="action.handler(entry)">
        <span *ngIf="action.iconClass" class="icon" [ngClass]="action.iconClass"></span> <ng-container>{{ action.label }}</ng-container>
      </a>
    </li>
  </ul>
</div>