mirror of
				https://github.com/richard-loafle/fuse-angular.git
				synced 2025-11-04 11:53:33 +00:00 
			
		
		
		
	Trigger expand/collapse of the navigation on ngOnInit to update the active item
This commit is contained in:
		
							parent
							
								
									2bbc90af64
								
							
						
					
					
						commit
						0d8fe0be72
					
				@ -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()
 | 
			
		||||
    {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user