theme run classes

This commit is contained in:
nixa 2016-05-17 14:13:56 +03:00
parent e7595af72c
commit 9d0fef1dd3
7 changed files with 55 additions and 20 deletions

View file

@ -0,0 +1,29 @@
import {Directive, HostBinding} from '@angular/core';
import {BaThemeConfigProvider, isMobile} from '../../../theme';
@Directive({
selector: '[baThemeRun]'
})
export class BaThemeRun {
@HostBinding('class.blur-theme') isBlur:boolean = false;
@HostBinding('class.mobile') isMobile:boolean = false;
constructor(private _baConfig:BaThemeConfigProvider) {
}
ngOnInit() {
this._assignBlur();
this._assingMobile();
}
// TODO: assign any theme class, not only hardcoded blur
private _assignBlur() {
this.isBlur = this._baConfig.get().theme.blur;
}
private _assingMobile() {
this.isMobile = isMobile();
}
}

View file

@ -0,0 +1 @@
export * from './baThemeRun.directive.ts';

View file

@ -1 +1,2 @@
export * from './scrollPosition';
export * from './baThemeRun';