Add open attribute on details which are supposed to be open by default instead of opening them with JS

This commit is contained in:
Guillaume Gomez 2021-04-26 10:43:49 +02:00
parent 9b44c4b29c
commit 6c8969c43c
2 changed files with 2 additions and 4 deletions

View file

@ -1305,7 +1305,7 @@ fn render_impl(
if let Some(use_absolute) = use_absolute { if let Some(use_absolute) = use_absolute {
write!( write!(
w, w,
"<details class=\"rustdoc-toggle implementors-toggle\">\ "<details class=\"rustdoc-toggle implementors-toggle\" open>\
<summary>\ <summary>\
<h3 id=\"{}\" class=\"impl\"{}>\ <h3 id=\"{}\" class=\"impl\"{}>\
<code class=\"in-band\">", <code class=\"in-band\">",
@ -1334,7 +1334,7 @@ fn render_impl(
} else { } else {
write!( write!(
w, w,
"<details class=\"rustdoc-toggle implementors-toggle\">\ "<details class=\"rustdoc-toggle implementors-toggle\" open>\
<summary>\ <summary>\
<h3 id=\"{}\" class=\"impl\"{}>\ <h3 id=\"{}\" class=\"impl\"{}>\
<code class=\"in-band\">{}</code>", <code class=\"in-band\">{}</code>",

View file

@ -1429,8 +1429,6 @@ function hideThemeButtonState() {
} else if (nextTagName !== "DETAILS") { } else if (nextTagName !== "DETAILS") {
e.nextElementSibling.style.display = "block"; e.nextElementSibling.style.display = "block";
} }
} else if (e.tagName === "DETAILS") {
e.open = true;
} }
}); });
} }