From 7a199010c8dbd8b66a9368fb034a20fa9e7db38f Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 16 May 2020 14:21:16 +0100 Subject: [PATCH] active theme now shown in the settings page --- public/js/settings.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/js/settings.js b/public/js/settings.js index b33eaf850..e777f3c74 100644 --- a/public/js/settings.js +++ b/public/js/settings.js @@ -9,12 +9,12 @@ function updateSettingsPage(){ } }) - - setSettingsButton('smoothCaret', config.smoothCaret); setSettingsButton('quickTab', config.quickTab); setSettingsButton('liveWpm', config.showLiveWpm); setSettingsButton('keyTips', config.showKeyTips); + setActiveThemeButton(config.theme); + if (config.showKeyTips) { $(".pageSettings .tip").removeClass('hidden'); @@ -25,6 +25,11 @@ function updateSettingsPage(){ } +function setActiveThemeButton(theme) { + $(".pageSettings .themes .theme").removeClass('active'); + $(".pageSettings .themes .theme[theme=" + theme + "]").addClass('active'); +} + function setSettingsButton(buttonSection,tf) { if (tf) { $(".pageSettings .section."+buttonSection+" .buttons .button.on").addClass('active');