mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-01-05 00:58:50 +01:00
fix(baSidebar): fix current selected menu
This commit is contained in:
parent
9312084fa4
commit
affc122a77
2 changed files with 8 additions and 17 deletions
|
|
@ -35,7 +35,7 @@ export class BaSidebar {
|
|||
private _state:AppState) {
|
||||
|
||||
this.menuItems = this._sidebarService.getMenuItems();
|
||||
this._onRouteChange = this._router.root.subscribe((path) => this._selectMenuItem(path));
|
||||
this._onRouteChange = this._router.root.subscribe((path) => this._selectMenuItem());
|
||||
this._state.subscribe('menu.isCollapsed', (isCollapsed) => {
|
||||
this.isMenuCollapsed = isCollapsed;
|
||||
});
|
||||
|
|
@ -113,9 +113,9 @@ export class BaSidebar {
|
|||
return window.innerWidth <= layoutSizes.resWidthCollapseSidebar;
|
||||
}
|
||||
|
||||
private _selectMenuItem(currentPath = null):void {
|
||||
private _selectMenuItem():void {
|
||||
|
||||
let currentMenu = this._sidebarService.setRouter(this._router).selectMenuItem(this.menuItems, currentPath);
|
||||
let currentMenu = this._sidebarService.setRouter(this._router).selectMenuItem(this.menuItems);
|
||||
this._state.notifyDataChanged('menu.activeLink', currentMenu);
|
||||
// hide menu after natigation on mobile devises
|
||||
if (this._shouldMenuCollapse()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue