diff --git a/src/app/core/components/navigation/vertical/nav-collapse/nav-vertical-collapse.component.ts b/src/app/core/components/navigation/vertical/nav-collapse/nav-vertical-collapse.component.ts index af40fa3b..31712d66 100644 --- a/src/app/core/components/navigation/vertical/nav-collapse/nav-vertical-collapse.component.ts +++ b/src/app/core/components/navigation/vertical/nav-collapse/nav-vertical-collapse.component.ts @@ -69,6 +69,20 @@ export class FuseNavVerticalCollapseComponent implements OnInit ); } + ngOnInit() + { + // Check if the url can be found in + // one of the children of this item + if ( this.isUrlInChildren(this.item, this.router.url) ) + { + this.expand(); + } + else + { + this.collapse(); + } + } + /** * Toggle collapse * @@ -108,6 +122,7 @@ export class FuseNavVerticalCollapseComponent implements OnInit { return; } + this.isOpen = false; this.navigationService.onNavCollapseToggle.emit(); } @@ -175,8 +190,4 @@ export class FuseNavVerticalCollapseComponent implements OnInit return false; } - ngOnInit() - { - } - }