mirror of https://github.com/Chocobozzz/PeerTube
Fix top menu dropdowns
parent
43373e777b
commit
ddfed6aedf
|
@ -28,7 +28,7 @@
|
||||||
<li *ngFor="let menuChild of menuEntry.children">
|
<li *ngFor="let menuChild of menuEntry.children">
|
||||||
<a
|
<a
|
||||||
*ngIf="isDisplayed(menuChild)" ngbDropdownItem
|
*ngIf="isDisplayed(menuChild)" ngbDropdownItem
|
||||||
[ngClass]="{ icon: hasIcons }" routerLinkActive="active" ariaCurrentWhenActive="page"
|
routerLinkActive="active" ariaCurrentWhenActive="page"
|
||||||
[routerLink]="menuChild.routerLink" #routerLink (click)="onActiveLinkScrollToTop(routerLink)"
|
[routerLink]="menuChild.routerLink" #routerLink (click)="onActiveLinkScrollToTop(routerLink)"
|
||||||
[queryParams]="menuChild.queryParams"
|
[queryParams]="menuChild.queryParams"
|
||||||
>
|
>
|
||||||
|
|
|
@ -16,7 +16,7 @@ ul {
|
||||||
margin-top: 0 !important;
|
margin-top: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon {
|
.dropdown-menu .dropdown-item {
|
||||||
@include dropdown-with-icon-item;
|
@include dropdown-with-icon-item;
|
||||||
|
|
||||||
top: -1px;
|
top: -1px;
|
||||||
|
|
|
@ -18,7 +18,7 @@ export type TopMenuDropdownParam = {
|
||||||
label: string
|
label: string
|
||||||
routerLink: string
|
routerLink: string
|
||||||
queryParams?: { [id: string]: string }
|
queryParams?: { [id: string]: string }
|
||||||
iconName?: GlobalIconName
|
iconName: GlobalIconName
|
||||||
|
|
||||||
isDisplayed?: () => boolean // Default: () => true
|
isDisplayed?: () => boolean // Default: () => true
|
||||||
}[]
|
}[]
|
||||||
|
@ -80,10 +80,6 @@ export class TopMenuDropdownComponent implements OnInit, OnDestroy {
|
||||||
this.routeSub = this.router.events
|
this.routeSub = this.router.events
|
||||||
.pipe(filter(event => event instanceof NavigationEnd))
|
.pipe(filter(event => event instanceof NavigationEnd))
|
||||||
.subscribe(() => this.updateChildLabels(window.location.pathname))
|
.subscribe(() => this.updateChildLabels(window.location.pathname))
|
||||||
|
|
||||||
this.hasIcons = this.menuEntries.some(
|
|
||||||
e => e.children?.some(c => !!c.iconName)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy () {
|
ngOnDestroy () {
|
||||||
|
|
Loading…
Reference in New Issue