Put back "auto-collapse-implementors" setting

This commit is contained in:
Guillaume Gomez 2021-08-30 16:11:10 +02:00
parent 8553c199e7
commit eb91366433
2 changed files with 6 additions and 0 deletions

View File

@ -453,6 +453,7 @@ fn settings(root_path: &str, suffix: &str, themes: &[StylePath]) -> Result<Strin
("auto-hide-method-docs", "Auto-hide item methods' documentation", false).into(),
("auto-hide-trait-implementations", "Auto-hide trait implementation documentation", false)
.into(),
("auto-collapse-implementors", "Auto-hide implementors of a trait", true).into(),
("go-to-only-result", "Directly go to item in search if there is only one result", false)
.into(),
("line-numbers", "Show line numbers on code examples", false).into(),

View File

@ -789,6 +789,7 @@ function hideThemeButtonState() {
}
var hideMethodDocs = getSettingValue("auto-hide-method-docs") === "true";
var hideImplementors = getSettingValue("auto-collapse-implementors") !== "false";
var hideImplementations = getSettingValue("auto-hide-trait-implementations") === "true";
var hideLargeItemContents = getSettingValue("auto-hide-large-items") !== "false";
@ -806,6 +807,10 @@ function hideThemeButtonState() {
setImplementorsTogglesOpen("blanket-implementations-list", false);
}
if (!hideImplementors) {
setImplementorsTogglesOpen("implementors-list", true);
}
onEachLazy(document.getElementsByClassName("rustdoc-toggle"), function (e) {
if (!hideLargeItemContents && hasClass(e, "type-contents-toggle")) {
e.open = true;