dees-domtools/ts/domtools.classes.thememanager.ts

28 lines
774 B
TypeScript
Raw Normal View History

2020-11-23 20:41:26 +00:00
import { DomTools } from './domtools.classes.domtools';
import * as plugins from './domtools.plugins';
export class ThemeManager {
public domtoolsRef: DomTools;
constructor(domtoolsRefArg: DomTools) {
this.domtoolsRef = domtoolsRefArg;
}
public goBright() {
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
const goBright = (elementArg as any).goBright;
if (typeof goBright === 'boolean') {
(elementArg as any).goBright = true;
}
});
}
public goDark() {
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
const goBright = (elementArg as any).goBright;
if (typeof goBright === 'boolean') {
(elementArg as any).goBright = false;
}
});
}
}