Skip to content

Commit

Permalink
fix: separated root and options attribute update
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderBazukevich authored and ala-n committed Jul 29, 2021
1 parent 40d7872 commit 546ca5c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/options/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,22 @@ export class UIPOptions extends UIPPlugin {
const mode = target.getAttribute('mode');
const theme = target.getAttribute('theme');

if (mode) this.updateModeMarker(mode);
if (theme) this.updateThemeMarker(theme);
if (mode) {
this.mode = mode;
this.updateModeMarker(mode);
}

if (theme) {
this.theme = theme;
this.updateThemeMarker(theme);
}
}

protected updateModeMarker(mode: string) {
this.mode = mode;
if (this.root) this.root.mode = mode;
}

protected updateThemeMarker(theme: string) {
this.theme = theme;
if (this.root) this.root.theme = theme;
}

Expand Down

0 comments on commit 546ca5c

Please sign in to comment.