],
)
.into(),
- (
- "Auto-hide item declarations",
- vec![
- ("auto-hide-struct", "Auto-hide structs declaration", true),
- ("auto-hide-enum", "Auto-hide enums declaration", false),
- ("auto-hide-union", "Auto-hide unions declaration", true),
- ("auto-hide-trait", "Auto-hide traits declaration", true),
- ("auto-hide-macro", "Auto-hide macros declaration", false),
- ],
- )
- .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)
});
}
}
- var showItemDeclarations = getSettingValue("auto-hide-" + className);
- if (showItemDeclarations === null) {
- if (className === "enum" || className === "macro") {
- showItemDeclarations = "false";
- } else if (className === "struct" || className === "union" || className === "trait") {
- showItemDeclarations = "true";
- } else {
- // In case we found an unknown type, we just use the "parent" value.
- showItemDeclarations = getSettingValue("auto-hide-declarations");
- }
- }
- showItemDeclarations = showItemDeclarations === "false";
+
function buildToggleWrapper(e) {
if (hasClass(e, "autohide")) {
var wrap = e.previousElementSibling;
var extraClass;
if (hasClass(e, "type-decl")) {
- fontSize = "20px";
- otherMessage = " Show declaration";
- if (showItemDeclarations === false) {
- extraClass = "collapsed";
- }
+ // We do something special for these
+ return;
} else if (hasClass(e, "sub-variant")) {
otherMessage = " Show fields";
} else if (hasClass(e, "non-exhaustive")) {
otherMessage,
fontSize,
extraClass,
- hasClass(e, "type-decl") === false || showItemDeclarations === true),
+ false),
e);
- if (hasClass(e, "type-decl") === true && showItemDeclarations === true) {
- collapseDocs(e.previousSibling.childNodes[0], "toggle");
- }
if (hasClass(e, "non-exhaustive") === true) {
collapseDocs(e.previousSibling.childNodes[0], "toggle");
}