Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/theme.js')
-rw-r--r--src/js/theme.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/js/theme.js b/src/js/theme.js
index 06cd237..719f0fd 100644
--- a/src/js/theme.js
+++ b/src/js/theme.js
@@ -83,8 +83,13 @@ class Theme {
initSwitchTheme() {
this.util.forEach(document.getElementsByClassName('theme-switch'), $themeSwitch => {
$themeSwitch.addEventListener('click', () => {
- if (document.body.getAttribute('theme') === 'dark') document.body.setAttribute('theme', 'light');
- else document.body.setAttribute('theme', 'dark');
+ if (document.body.getAttribute('theme') === 'dark') {
+ document.body.setAttribute('theme', 'light');
+ window.REMARK42.changeTheme('light');
+ } else {
+ document.body.setAttribute('theme', 'dark');
+ window.REMARK42.changeTheme('dark');
+ }
this.isDark = !this.isDark;
window.localStorage && localStorage.setItem('theme', this.isDark ? 'dark' : 'light');
for (let event of this.switchThemeEventSet) event();