Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
d059862841 | |||
ad34affb9e | |||
011b3fb76a | |||
47099d02b5 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-domtools",
|
"name": "@designestate/dees-domtools",
|
||||||
"version": "1.0.67",
|
"version": "1.0.69",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-domtools",
|
"name": "@designestate/dees-domtools",
|
||||||
"version": "1.0.67",
|
"version": "1.0.69",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "tools to simplify complex css structures",
|
"description": "tools to simplify complex css structures",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
|
@ -5,7 +5,7 @@ import * as plugins from './domtools.plugins';
|
|||||||
export class ThemeManager {
|
export class ThemeManager {
|
||||||
public domtoolsRef: DomTools;
|
public domtoolsRef: DomTools;
|
||||||
|
|
||||||
goBrightBoolean = false;
|
public goBrightBoolean = false;
|
||||||
|
|
||||||
constructor(domtoolsRefArg: DomTools) {
|
constructor(domtoolsRefArg: DomTools) {
|
||||||
this.domtoolsRef = domtoolsRefArg;
|
this.domtoolsRef = domtoolsRefArg;
|
||||||
@ -21,15 +21,24 @@ export class ThemeManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public goBright() {
|
private async updateAllConnectedElements() {
|
||||||
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
|
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
|
||||||
await this.setThemeStatusForElement(elementArg, true);
|
await this.setThemeStatusForElement(elementArg, this.goBrightBoolean);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public goBright() {
|
||||||
|
this.goBrightBoolean = true;
|
||||||
|
this.updateAllConnectedElements();
|
||||||
|
}
|
||||||
|
|
||||||
public goDark() {
|
public goDark() {
|
||||||
this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => {
|
this.goBrightBoolean = false;
|
||||||
await this.setThemeStatusForElement(elementArg, false);
|
this.updateAllConnectedElements();
|
||||||
});
|
}
|
||||||
|
|
||||||
|
public toggleDarkBright() {
|
||||||
|
this.goBrightBoolean = !this.goBrightBoolean;
|
||||||
|
this.updateAllConnectedElements();
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user