feat: evaluate nodes with hidden children as dropdowns

pull/4445/head
Arman Ozak 5 years ago
parent 51159b3693
commit 01e01e4799

@ -1,7 +1,7 @@
<ul class="navbar-nav">
<ng-container
*ngFor="let route of routes.visible$ | async; trackBy: trackByFn"
[ngTemplateOutlet]="route?.children?.length ? dropdownLink : defaultLink"
[ngTemplateOutlet]="isDropdown(route) ? dropdownLink : defaultLink"
[ngTemplateOutletContext]="{ $implicit: route }"
>
</ng-container>

@ -11,4 +11,8 @@ export class RoutesComponent {
trackByFn: TrackByFunction<TreeNode<ABP.Route>> = (_, item) => item.name;
constructor(public readonly routes: RoutesService) {}
isDropdown(node: TreeNode<ABP.Route>) {
return !node.isLeaf || this.routes.hasInvisibleChild(node.name);
}
}

Loading…
Cancel
Save