From a56ad36a4226b470a544b545cf2308dc14177f23 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Tue, 13 Mar 2018 17:38:01 +0200 Subject: [PATCH] Do not repaint theme on page load --- client/js/options.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/js/options.js b/client/js/options.js index e2f05b78..7985818c 100644 --- a/client/js/options.js +++ b/client/js/options.js @@ -63,8 +63,8 @@ if (typeof userSettings.userStyles === "string" && !noCSSparamReg.test(window.lo $userStyles.html(userSettings.userStyles); } -if (typeof userSettings.theme === "string") { - $theme.prop("href", `themes/${userSettings.theme}.css`); +if (typeof userSettings.theme === "string" && $theme.attr("href") !== `themes/${userSettings.theme}.css`) { + $theme.attr("href", `themes/${userSettings.theme}.css`); } userSettings = null; @@ -110,7 +110,11 @@ function applySetting(name, value) { } else if (name === "coloredNicks") { $chat.toggleClass("colored-nicks", value); } else if (name === "theme") { - $theme.prop("href", `themes/${value}.css`); + value = `themes/${value}.css`; + + if ($theme.attr("href") !== value) { + $theme.attr("href", value); + } } else if (name === "userStyles" && !noCSSparamReg.test(window.location.search)) { $userStyles.html(value); } else if (name === "highlights") {