aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts')
-rw-r--r--client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts
index 66f8f7e55..c3cd22307 100644
--- a/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts
+++ b/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.ts
@@ -9,12 +9,14 @@ import { NgbDropdown, NgbModal } from '@ng-bootstrap/ng-bootstrap'
9export type TopMenuDropdownParam = { 9export type TopMenuDropdownParam = {
10 label: string 10 label: string
11 routerLink?: string 11 routerLink?: string
12 isDisplayed?: () => boolean // Default: () => true
12 13
13 children?: { 14 children?: {
14 label: string 15 label: string
15 routerLink: string 16 routerLink: string
16
17 iconName?: GlobalIconName 17 iconName?: GlobalIconName
18
19 isDisplayed?: () => boolean // Default: () => true
18 }[] 20 }[]
19} 21}
20 22
@@ -92,6 +94,12 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy {
92 this.modalService.dismissAll() 94 this.modalService.dismissAll()
93 } 95 }
94 96
97 isDisplayed (obj: { isDisplayed?: () => boolean }) {
98 if (typeof obj.isDisplayed !== 'function') return true
99
100 return obj.isDisplayed()
101 }
102
95 private updateChildLabels (path: string) { 103 private updateChildLabels (path: string) {
96 this.suffixLabels = {} 104 this.suffixLabels = {}
97 105