Skip to content

Commit 8c9c796

Browse files
Make theme selector button visible even for non-local pages
1 parent c42d846 commit 8c9c796

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/librustdoc/html/static/js/main.js

-5
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,10 @@ function hideThemeButtonState() {
135135

136136
// Set up the theme picker list.
137137
(function () {
138-
if (!document.location.href.startsWith("file:///")) {
139-
return;
140-
}
141138
var themeChoices = getThemesElement();
142139
var themePicker = getThemePickerElement();
143140
var availableThemes = getVar("themes").split(",");
144141

145-
removeClass(themeChoices.parentElement, "hidden");
146-
147142
function switchThemeButtonState() {
148143
if (themeChoices.style.display === "block") {
149144
hideThemeButtonState();

src/librustdoc/html/templates/page.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ <h2 class="location"></h2>
108108
{%- endif -%}
109109
</a> {#- -#}
110110
<nav class="sub"> {#- -#}
111-
<div class="theme-picker hidden"> {#- -#}
111+
<div class="theme-picker"> {#- -#}
112112
<button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"> {#- -#}
113113
<img width="22" height="22" alt="Pick another theme!" {# -#}
114114
src="{{static_root_path|safe}}brush{{page.resource_suffix}}.svg"> {#- -#}

0 commit comments

Comments
 (0)