mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-26 13:54:06 +00:00
rustdoc: Add setting for hiding large items
This commit is contained in:
parent
173cbecc66
commit
256e594b0a
@ -486,6 +486,7 @@ fn settings(root_path: &str, suffix: &str, themes: &[StylePath]) -> Result<Strin
|
||||
],
|
||||
)
|
||||
.into(),
|
||||
("auto-hide-large-items", "Auto-hide item contents for large items.", true).into(),
|
||||
("auto-hide-attributes", "Auto-hide item attributes.", true).into(),
|
||||
("auto-hide-method-docs", "Auto-hide item methods' documentation", false).into(),
|
||||
("auto-hide-trait-implementations", "Auto-hide trait implementation documentation", true)
|
||||
|
@ -2705,8 +2705,12 @@ function hideThemeButtonState() {
|
||||
}
|
||||
} else if (hasClass(e, "type-contents-toggle")) {
|
||||
let text = e.getAttribute("data-toggle-text");
|
||||
let tog = createToggle(toggle, `Show ${text}`, null, "", true);
|
||||
let hideItemContents = getSettingValue("auto-hide-large-items") !== "false";
|
||||
let tog = createToggle(toggle, `Show ${text}`, null, "", !hideItemContents);
|
||||
e.parentNode.insertBefore(tog, e);
|
||||
if (hideItemContents) {
|
||||
collapseDocs(e.previousSibling.childNodes[0], "toggle");
|
||||
}
|
||||
}
|
||||
if (e.parentNode.id === "main") {
|
||||
var otherMessage = "";
|
||||
|
Loading…
Reference in New Issue
Block a user