mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-02-25 01:14:06 +01:00
menu collapsed state change on pageTop button click
This commit is contained in:
parent
6a7266ddb3
commit
3b02486219
2 changed files with 16 additions and 2 deletions
|
|
@ -1,8 +1,10 @@
|
|||
import {Component, ViewEncapsulation} from 'angular2/core';
|
||||
import {Subscription} from 'rxjs/Subscription';
|
||||
|
||||
import {MsgCenter} from '../msgCenter';
|
||||
import {ProfilePicturePipe} from '../pipes/image/profile-picture.pipe';
|
||||
import {ScrollPosition} from '../directives/scrollPosition.directive';
|
||||
import {SidebarStateService} from '../sidebar/sidebarState.service'
|
||||
|
||||
@Component({
|
||||
selector: 'page-top',
|
||||
|
|
@ -13,8 +15,20 @@ import {ScrollPosition} from '../directives/scrollPosition.directive';
|
|||
})
|
||||
export class PageTop {
|
||||
isScrolled: Boolean = false;
|
||||
isMenuCollapsed: Boolean = false;
|
||||
|
||||
private _sidebarStateSubscription: Subscription;
|
||||
|
||||
constructor(private _sidebarStateService: SidebarStateService) {
|
||||
this._sidebarStateSubscription = this._sidebarStateService.getStateStream().subscribe((isCollapsed) => this.isMenuCollapsed = isCollapsed);
|
||||
}
|
||||
|
||||
toggleMenu() {
|
||||
this.isMenuCollapsed = !this.isMenuCollapsed;
|
||||
this._sidebarStateService.stateChanged(this.isMenuCollapsed);
|
||||
}
|
||||
|
||||
scrolledChanged(isScrolled) {
|
||||
this.isScrolled = isScrolled;
|
||||
this.isScrolled = isScrolled;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue