From ec6f624a29112ef789df751e1196964e6a5cb572 Mon Sep 17 00:00:00 2001 From: Yvon Cui Date: Wed, 19 Jan 2022 00:49:18 -0500 Subject: [PATCH] bug fix: popup window didn't show existing selection --- Extensions/combined/popup.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Extensions/combined/popup.js b/Extensions/combined/popup.js index e3a9652..26d40d7 100644 --- a/Extensions/combined/popup.js +++ b/Extensions/combined/popup.js @@ -167,8 +167,15 @@ function handleColoredBarChangeEvent(value) { function handleColorThemeChangeEvent(value) { config.colorTheme = value; - document.getElementById("color_theme_example_like").style.backgroundColor = getColorFromTheme(value, true); - document.getElementById("color_theme_example_dislike").style.backgroundColor = getColorFromTheme(value, false); + document + .getElementById("color_theme") + .querySelector('option[value="' + value + '"]').selected = true; + updateColorThemePreviewContent(value); +} + +function updateColorThemePreviewContent(themeName) { + document.getElementById("color_theme_example_like").style.backgroundColor = getColorFromTheme(themeName, true); + document.getElementById("color_theme_example_dislike").style.backgroundColor = getColorFromTheme(themeName, false); } (async function getStatus() {