diff options
Diffstat (limited to 'client/src/app/shared/buttons')
3 files changed, 18 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 cd993db9f..14cfe9a22 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.html +++ b/client/src/app/shared/buttons/action-dropdown.component.html | |||
@@ -24,17 +24,27 @@ | |||
24 | </div> | 24 | </div> |
25 | </ng-template> | 25 | </ng-template> |
26 | 26 | ||
27 | <a *ngIf="action.linkBuilder" [ngClass]="{ 'with-icon': !!action.iconName }" class="dropdown-item" [routerLink]="action.linkBuilder(entry)" [title]="action.title || ''"> | 27 | <a |
28 | *ngIf="action.linkBuilder && !action.isHeader" [ngClass]="{ 'with-icon': !!action.iconName }" | ||
29 | class="dropdown-item" [routerLink]="action.linkBuilder(entry)" [title]="action.title || ''" | ||
30 | > | ||
28 | <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container> | 31 | <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container> |
29 | </a> | 32 | </a> |
30 | 33 | ||
31 | <span | 34 | <span |
32 | *ngIf="!action.linkBuilder" [ngClass]="{ 'with-icon': !!action.iconName }" (click)="action.handler(entry)" | 35 | *ngIf="!action.linkBuilder && !action.isHeader" [ngClass]="{ 'with-icon': !!action.iconName }" |
33 | class="custom-action dropdown-item" role="button" [title]="action.title || ''" | 36 | class="custom-action dropdown-item" role="button" [title]="action.title || ''" (click)="action.handler(entry)" |
34 | > | 37 | > |
35 | <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container> | 38 | <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container> |
36 | </span> | 39 | </span> |
37 | 40 | ||
41 | <h6 | ||
42 | *ngIf="!action.linkBuilder && action.isHeader" [ngClass]="{ 'with-icon': !!action.iconName }" | ||
43 | class="dropdown-header" role="button" [title]="action.title || ''" (click)="action.handler(entry)" | ||
44 | > | ||
45 | <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container> | ||
46 | </h6> | ||
47 | |||
38 | </ng-container> | 48 | </ng-container> |
39 | </ng-container> | 49 | </ng-container> |
40 | 50 | ||
diff --git a/client/src/app/shared/buttons/action-dropdown.component.scss b/client/src/app/shared/buttons/action-dropdown.component.scss index 442c90984..7a030f32c 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.scss +++ b/client/src/app/shared/buttons/action-dropdown.component.scss | |||
@@ -51,6 +51,10 @@ | |||
51 | } | 51 | } |
52 | 52 | ||
53 | .dropdown-menu { | 53 | .dropdown-menu { |
54 | .dropdown-header { | ||
55 | padding: 0.2rem 1rem; | ||
56 | } | ||
57 | |||
54 | .dropdown-item { | 58 | .dropdown-item { |
55 | display: flex; | 59 | display: flex; |
56 | cursor: pointer; | 60 | cursor: pointer; |
diff --git a/client/src/app/shared/buttons/action-dropdown.component.ts b/client/src/app/shared/buttons/action-dropdown.component.ts index 6649b092a..8fcaa38b9 100644 --- a/client/src/app/shared/buttons/action-dropdown.component.ts +++ b/client/src/app/shared/buttons/action-dropdown.component.ts | |||
@@ -9,6 +9,7 @@ export type DropdownAction<T> = { | |||
9 | handler?: (a: T) => any | 9 | handler?: (a: T) => any |
10 | linkBuilder?: (a: T) => (string | number)[] | 10 | linkBuilder?: (a: T) => (string | number)[] |
11 | isDisplayed?: (a: T) => boolean | 11 | isDisplayed?: (a: T) => boolean |
12 | isHeader?: boolean | ||
12 | } | 13 | } |
13 | 14 | ||
14 | export type DropdownButtonSize = 'normal' | 'small' | 15 | export type DropdownButtonSize = 'normal' | 'small' |