aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/shared/shared-main/misc/top-menu-dropdown.component.html
blob: d96fdbdc6d6335875ab4fd4608413d1ec8532193 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                                                                                                                 
                                                                   
 






                                                                                   
 
                                                                                                 
                                                                
           



                                                               
                                             
                                                               



                              


                                                                                                   
                                            
       
                                                               


                           

                                                                   
                                          

                                                                      
                                                                                                                           
 


                                 

            

                 




                                                                     


                                                                   

                                                                                            
                                                                                                                           
 


                                 



                   
<div class="sub-menu" [ngClass]="{ 'sub-menu-fixed': !isBroadcastMessageDisplayed, 'no-scroll': isModalOpened }">
  <ng-container *ngFor="let menuEntry of menuEntries; index as id">

    <a
      *ngIf="menuEntry.routerLink && isDisplayed(menuEntry)" class="sub-menu-entry"
      [routerLink]="menuEntry.routerLink" routerLinkActive="active" #routerLink
      (click)="onActiveLinkScrollToTop(routerLink)"
    >
      {{ menuEntry.label }}
    </a>

    <div *ngIf="!menuEntry.routerLink && isDisplayed(menuEntry)" ngbDropdown class="parent-entry"
      #dropdown="ngbDropdown" autoClose="true" container="body">
      <span
        *ngIf="isInSmallView"
        tabindex=0
        [ngClass]="{ active: !!suffixLabels[menuEntry.label] }"
        (click)="openModal(id)" (keydown.enter)="openModal(id)"
        role="button" class="sub-menu-entry">
        <ng-container i18n>{{ menuEntry.label }}</ng-container>
      </span>

      <span
        *ngIf="!isInSmallView"
        tabindex=0
        [ngClass]="{ active: !!suffixLabels[menuEntry.label] }" ngbDropdownAnchor
        (click)="dropdownAnchorClicked(dropdown)" (keydown.enter)="dropdownAnchorClicked(dropdown)"
        role="button" class="sub-menu-entry"
      >
        <ng-container i18n>{{ menuEntry.label }}</ng-container>
      </span>

      <div ngbDropdownMenu>
        <ng-container *ngFor="let menuChild of menuEntry.children">
          <a *ngIf="isDisplayed(menuChild)" class="dropdown-item"
            [ngClass]="{ icon: hasIcons }"
            [routerLink]="menuChild.routerLink"
            #routerLink (click)="onActiveLinkScrollToTop(routerLink)">
            <my-global-icon *ngIf="menuChild.iconName" [iconName]="menuChild.iconName" aria-hidden="true"></my-global-icon>

            {{ menuChild.label }}
          </a>
        </ng-container>
      </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 }">
        <ng-container *ngFor="let menuChild of menuEntry.children">
          <a *ngIf="isDisplayed(menuChild)"
            [ngClass]="{ icon: hasIcons }"
            [routerLink]="menuChild.routerLink" routerLinkActive="active"
            #routerLink (click)="dismissOtherModals(); onActiveLinkScrollToTop(routerLink)">
            <my-global-icon *ngIf="menuChild.iconName" [iconName]="menuChild.iconName" aria-hidden="true"></my-global-icon>

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