Skip to content

Commit

Permalink
Fix confusion in theme picker functions
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 21, 2019
1 parent 7858dc2 commit 3375b05
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions src/librustdoc/html/render.rs
Expand Up @@ -876,22 +876,22 @@ r#"var themes = document.getElementById("theme-choices");
var themePicker = document.getElementById("theme-picker");
function showThemeButtonState() {{
themes.style.display = "none";
themePicker.style.borderBottomRightRadius = "3px";
themePicker.style.borderBottomLeftRadius = "3px";
}}
function hideThemeButtonState() {{
themes.style.display = "block";
themePicker.style.borderBottomRightRadius = "0";
themePicker.style.borderBottomLeftRadius = "0";
}}
function hideThemeButtonState() {{
themes.style.display = "none";
themePicker.style.borderBottomRightRadius = "3px";
themePicker.style.borderBottomLeftRadius = "3px";
}}
function switchThemeButtonState() {{
if (themes.style.display === "block") {{
showThemeButtonState();
}} else {{
hideThemeButtonState();
}} else {{
showThemeButtonState();
}}
}};
Expand Down
12 changes: 6 additions & 6 deletions src/librustdoc/html/static/main.js
Expand Up @@ -105,9 +105,9 @@ if (!DOMTokenList.prototype.remove) {
sidebar.appendChild(div);
}
}
var themePicker = document.getElementsByClassName("theme-picker");
if (themePicker && themePicker.length > 0) {
themePicker[0].style.display = "none";
var themePickers = document.getElementsByClassName("theme-picker");
if (themePickers && themePickers.length > 0) {
themePickers[0].style.display = "none";
}
}

Expand All @@ -123,9 +123,9 @@ if (!DOMTokenList.prototype.remove) {
filler.remove();
}
document.getElementsByTagName("body")[0].style.marginTop = "";
var themePicker = document.getElementsByClassName("theme-picker");
if (themePicker && themePicker.length > 0) {
themePicker[0].style.display = null;
var themePickers = document.getElementsByClassName("theme-picker");
if (themePickers && themePickers.length > 0) {
themePickers[0].style.display = null;
}
}

Expand Down

0 comments on commit 3375b05

Please sign in to comment.