From 47099d02b5c6a7f970f1e0244f6afe8c6e0b434c Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Tue, 24 Nov 2020 19:23:06 +0000 Subject: [PATCH] fix(core): update --- ts/domtools.classes.thememanager.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) 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