@@ -874,15 +874,23 @@ fn write_shared(
874
874
r#"var themes = document.getElementById("theme-choices");
875
875
var themePicker = document.getElementById("theme-picker");
876
876
877
+ function showThemeButtonState() {{
878
+ themes.style.display = "none";
879
+ themePicker.style.borderBottomRightRadius = "3px";
880
+ themePicker.style.borderBottomLeftRadius = "3px";
881
+ }}
882
+
883
+ function hideThemeButtonState() {{
884
+ themes.style.display = "block";
885
+ themePicker.style.borderBottomRightRadius = "0";
886
+ themePicker.style.borderBottomLeftRadius = "0";
887
+ }}
888
+
877
889
function switchThemeButtonState() {{
878
890
if (themes.style.display === "block") {{
879
- themes.style.display = "none";
880
- themePicker.style.borderBottomRightRadius = "3px";
881
- themePicker.style.borderBottomLeftRadius = "3px";
891
+ showThemeButtonState();
882
892
}} else {{
883
- themes.style.display = "block";
884
- themePicker.style.borderBottomRightRadius = "0";
885
- themePicker.style.borderBottomLeftRadius = "0";
893
+ hideThemeButtonState();
886
894
}}
887
895
}};
888
896
@@ -895,7 +903,7 @@ function handleThemeButtonsBlur(e) {{
895
903
(!related ||
896
904
(related.id !== "themePicker" &&
897
905
(!related.parentNode || related.parentNode.id !== "theme-choices")))) {{
898
- switchThemeButtonState ();
906
+ hideThemeButtonState ();
899
907
}}
900
908
}}
901
909
0 commit comments