diff --git a/ts/domtools.classes.thememanager.ts b/ts/domtools.classes.thememanager.ts index 0935ff5..7be89bc 100644 --- a/ts/domtools.classes.thememanager.ts +++ b/ts/domtools.classes.thememanager.ts @@ -21,15 +21,24 @@ export class ThemeManager { } } - public goBright() { + private async updateAllConnectedElements() { 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() { - this.domtoolsRef.elementInstrumenter.forEachelement(async elementArg => { - await this.setThemeStatusForElement(elementArg, false); - }); + this.goBrightBoolean = false; + this.updateAllConnectedElements(); + } + + public toggleDarkBright() { + this.goBrightBoolean = !this.goBrightBoolean; + this.updateAllConnectedElements(); } } \ No newline at end of file