mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-02-10 18:34:20 +01:00
app state
This commit is contained in:
parent
e6be0e4519
commit
38e1c6cfa3
8 changed files with 62 additions and 57 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import {Component, ElementRef, HostListener, ViewEncapsulation} from '@angular/core';
|
||||
import {Router} from '@angular/router-deprecated';
|
||||
|
||||
import {ThemeGlobal, layoutSizes} from '../../../theme';
|
||||
import {AppState} from '../../../app.state';
|
||||
import {layoutSizes} from '../../../theme';
|
||||
import {SidebarService} from './sidebar.service';
|
||||
|
||||
// TODO: separate menu and sidebar
|
||||
|
|
@ -33,7 +34,7 @@ export class Sidebar {
|
|||
constructor(private _elementRef:ElementRef,
|
||||
private _router:Router,
|
||||
private _sidebarService:SidebarService,
|
||||
private _themeGlobal:ThemeGlobal) {
|
||||
private _state:AppState) {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +71,7 @@ export class Sidebar {
|
|||
|
||||
menuCollapseStateChange(isCollapsed) {
|
||||
this.isMenuCollapsed = isCollapsed;
|
||||
this._themeGlobal.setData('menu.isCollapsed', this.isMenuCollapsed);
|
||||
this._state.notifyDataChanged('menu.isCollapsed', this.isMenuCollapsed);
|
||||
}
|
||||
|
||||
hoverItem($event) {
|
||||
|
|
@ -123,6 +124,6 @@ export class Sidebar {
|
|||
});
|
||||
|
||||
// notifies all subscribers
|
||||
this._themeGlobal.setData('menu.activeLink', currentMenu);
|
||||
this._state.notifyDataChanged('menu.activeLink', currentMenu);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue