diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-10-12 17:59:56 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-10-12 19:00:24 -0400 |
commit | b086fca69fdbc74a44d31a06203b302493656151 (patch) | |
tree | ec5c2657e67463d3d89dc32b8c0a553d47a1c66d /ext/bg/js/settings-popup-preview.js | |
parent | 1da60aae2dcd08dd139abf14ca145510e136ee53 (diff) |
Add separate theme option for outer popup style
Diffstat (limited to 'ext/bg/js/settings-popup-preview.js')
-rw-r--r-- | ext/bg/js/settings-popup-preview.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/bg/js/settings-popup-preview.js b/ext/bg/js/settings-popup-preview.js index 6f64c240..53a5f1d0 100644 --- a/ext/bg/js/settings-popup-preview.js +++ b/ext/bg/js/settings-popup-preview.js @@ -22,6 +22,7 @@ class SettingsPopupPreview { this.frontend = null; this.apiOptionsGetOld = apiOptionsGet; this.popupShown = false; + this.themeChangeTimeout = null; } static create() { @@ -97,6 +98,13 @@ class SettingsPopupPreview { onThemeDarkCheckboxChanged(node) { document.documentElement.classList.toggle('dark', node.checked); + if (this.themeChangeTimeout !== null) { + clearTimeout(this.themeChangeTimeout); + } + this.themeChangeTimeout = setTimeout(() => { + this.themeChangeTimeout = null; + this.frontend.popup.updateTheme(); + }, 300); } setText(text) { |