mirror of
https://github.com/akveo/ngx-admin.git
synced 2026-01-25 10:46:09 +01:00
theme run classes
This commit is contained in:
parent
e7595af72c
commit
9d0fef1dd3
7 changed files with 55 additions and 20 deletions
29
src/app/theme/directives/baThemeRun/baThemeRun.directive.ts
Normal file
29
src/app/theme/directives/baThemeRun/baThemeRun.directive.ts
Normal 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();
|
||||
}
|
||||
}
|
||||
1
src/app/theme/directives/baThemeRun/index.ts
Normal file
1
src/app/theme/directives/baThemeRun/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from './baThemeRun.directive.ts';
|
||||
|
|
@ -1 +1,2 @@
|
|||
export * from './scrollPosition';
|
||||
export * from './baThemeRun';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue