aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/menu/top-menu-dropdown.component.html
blob: 7b13eade4c355ee96be9a241e65b3bdb1cfc7433 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<div class="sub-menu" [ngClass]="{ 'no-scroll': isModalOpened }">
  <ng-container *ngFor="let menuEntry of menuEntries; index as id">

    <a *ngIf="menuEntry.routerLink" [routerLink]="menuEntry.routerLink" routerLinkActive="active" class="title-page title-page-settings">{{ menuEntry.label }}</a>

    <div *ngIf="!menuEntry.routerLink" ngbDropdown class="parent-entry"
      #dropdown="ngbDropdown" (mouseleave)="closeDropdownIfHovered(dropdown)">
      <span
        *ngIf="isInSmallView"
        [ngClass]="{ active: !!suffixLabels[menuEntry.label] }"
        (click)="openModal(id)" role="button" class="title-page title-page-settings">
        <ng-container i18n>{{ menuEntry.label }}</ng-container>
        <ng-container *ngIf="!!suffixLabels[menuEntry.label]"> - {{ suffixLabels[menuEntry.label] }}</ng-container>
      </span>

      <span
        *ngIf="!isInSmallView"
        (mouseenter)="openDropdownOnHover(dropdown)" [ngClass]="{ active: !!suffixLabels[menuEntry.label] }" ngbDropdownAnchor
        (click)="dropdownAnchorClicked(dropdown)" role="button" class="title-page title-page-settings"
      >
        <ng-container i18n>{{ menuEntry.label }}</ng-container>
        <ng-container *ngIf="!!suffixLabels[menuEntry.label]"> - {{ suffixLabels[menuEntry.label] }}</ng-container>
      </span>

      <div ngbDropdownMenu>
        <a *ngFor="let menuChild of menuEntry.children" class="dropdown-item" [ngClass]="{ icon: hasIcons }" [routerLink]="menuChild.routerLink">
          <my-global-icon *ngIf="menuChild.iconName" [iconName]="menuChild.iconName"></my-global-icon>

          {{ menuChild.label }}
        </a>
      </div>
    </div>
  </ng-container>
</div>

<ng-template #modal let-close="close" let-dismiss="dismiss">
  <div class="modal-body">
    <ng-container *ngFor="let menuEntry of menuEntries; index as id">
      <div [ngClass]="{ hidden: id !== currentMenuEntryIndex }">
        <a *ngFor="let menuChild of menuEntry.children"
          [ngClass]="{ icon: hasIcons }"
          [routerLink]="menuChild.routerLink" routerLinkActive="active" (click)="dismissOtherModals()">
          <my-global-icon *ngIf="menuChild.iconName" [iconName]="menuChild.iconName"></my-global-icon>

          {{ menuChild.label }}
        </a>
      </div>
    </ng-container>
  </div>
</ng-template>