]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/shared/shared-main/misc/top-menu-dropdown.component.html
Fix top menu dropdown
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / shared-main / misc / top-menu-dropdown.component.html
1 <div class="sub-menu" [ngClass]="{ 'no-scroll': isModalOpened }">
2 <ng-container *ngFor="let menuEntry of menuEntries; index as id">
3
4 <a *ngIf="menuEntry.routerLink && isDisplayed(menuEntry)" [routerLink]="menuEntry.routerLink" routerLinkActive="active" class="title-page title-page-settings">{{ menuEntry.label }}</a>
5
6 <div *ngIf="!menuEntry.routerLink && isDisplayed(menuEntry)" ngbDropdown class="parent-entry"
7 #dropdown="ngbDropdown" autoClose="true">
8 <span
9 *ngIf="isInSmallView"
10 tabindex=0
11 [ngClass]="{ active: !!suffixLabels[menuEntry.label] }"
12 (click)="openModal(id)" (keydown.enter)="openModal(id)"
13 role="button" class="title-page title-page-settings">
14 <ng-container i18n>{{ menuEntry.label }}</ng-container>
15 </span>
16
17 <span
18 *ngIf="!isInSmallView"
19 tabindex=0
20 [ngClass]="{ active: !!suffixLabels[menuEntry.label] }" ngbDropdownAnchor
21 (click)="dropdownAnchorClicked(dropdown)" (keydown.enter)="dropdownAnchorClicked(dropdown)"
22 role="button" class="title-page title-page-settings"
23 >
24 <ng-container i18n>{{ menuEntry.label }}</ng-container>
25 </span>
26
27 <div ngbDropdownMenu>
28 <ng-container *ngFor="let menuChild of menuEntry.children">
29 <a *ngIf="isDisplayed(menuChild)" class="dropdown-item"
30 [ngClass]="{ icon: hasIcons }"
31 [routerLink]="menuChild.routerLink">
32 <my-global-icon *ngIf="menuChild.iconName" [iconName]="menuChild.iconName" aria-hidden="true"></my-global-icon>
33
34 {{ menuChild.label }}
35 </a>
36 </ng-container>
37 </div>
38 </div>
39 </ng-container>
40 </div>
41
42 <ng-template #modal let-close="close" let-dismiss="dismiss">
43 <div class="modal-body">
44 <ng-container *ngFor="let menuEntry of menuEntries; index as id">
45 <div [ngClass]="{ hidden: id !== currentMenuEntryIndex }">
46 <ng-container *ngFor="let menuChild of menuEntry.children">
47 <a *ngIf="isDisplayed(menuChild)"
48 [ngClass]="{ icon: hasIcons }"
49 [routerLink]="menuChild.routerLink" routerLinkActive="active" (click)="dismissOtherModals()">
50 <my-global-icon *ngIf="menuChild.iconName" [iconName]="menuChild.iconName" aria-hidden="true"></my-global-icon>
51
52 {{ menuChild.label }}
53 </a>
54 </ng-container>
55 </div>
56 </ng-container>
57 </div>
58 </ng-template>