Pārlūkot izejas kodu

bug fix: popup window didn't show existing selection

Yvon Cui 3 gadi atpakaļ
vecāks
revīzija
ec6f624a29
1 mainītis faili ar 9 papildinājumiem un 2 dzēšanām
  1. 9 2
      Extensions/combined/popup.js

+ 9 - 2
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() {