2016-05-12 13:53:13 +03:00
|
|
|
import {Component, ViewEncapsulation} from '@angular/core';
|
2016-04-21 21:49:53 +03:00
|
|
|
|
2016-05-04 11:49:36 +03:00
|
|
|
import {ThemeGlobal} from '../../../theme';
|
|
|
|
|
import {ProfilePicturePipe} from '../../pipes';
|
|
|
|
|
import {MsgCenter} from '../../components/msgCenter';
|
|
|
|
|
import {ScrollPosition} from '../../directives';
|
2016-04-25 19:33:47 +03:00
|
|
|
|
2016-04-21 21:49:53 +03:00
|
|
|
@Component({
|
2016-04-29 17:27:19 +03:00
|
|
|
selector: 'page-top',
|
|
|
|
|
styles: [require('./pageTop.scss')],
|
|
|
|
|
template: require('./pageTop.html'),
|
|
|
|
|
directives: [MsgCenter, ScrollPosition],
|
2016-05-12 13:53:13 +03:00
|
|
|
pipes: [ProfilePicturePipe],
|
|
|
|
|
encapsulation: ViewEncapsulation.None
|
2016-04-21 21:49:53 +03:00
|
|
|
})
|
2016-04-27 18:21:52 +03:00
|
|
|
export class PageTop {
|
2016-04-29 17:27:19 +03:00
|
|
|
isScrolled:Boolean = false;
|
|
|
|
|
isMenuCollapsed:boolean = false;
|
2016-04-29 12:32:37 +03:00
|
|
|
|
|
|
|
|
|
2016-05-02 14:40:12 +03:00
|
|
|
constructor(private _themeGlobal:ThemeGlobal) {
|
2016-04-29 17:27:19 +03:00
|
|
|
}
|
2016-04-29 12:32:37 +03:00
|
|
|
|
2016-04-29 17:27:19 +03:00
|
|
|
toggleMenu() {
|
|
|
|
|
this.isMenuCollapsed = !this.isMenuCollapsed;
|
2016-05-02 14:40:12 +03:00
|
|
|
this._themeGlobal.setData('menu.isCollapsed', this.isMenuCollapsed);
|
2016-04-29 17:27:19 +03:00
|
|
|
}
|
2016-04-27 18:21:52 +03:00
|
|
|
|
2016-04-29 17:27:19 +03:00
|
|
|
scrolledChanged(isScrolled) {
|
|
|
|
|
this.isScrolled = isScrolled;
|
|
|
|
|
}
|
2016-04-27 18:21:52 +03:00
|
|
|
}
|