Skip to content

Commit

Permalink
Fix invalid "expand description" display
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 30, 2018
1 parent 58c88e6 commit f55e986
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2088,7 +2088,7 @@
return wrapper;
}

var hideItemDeclarations = getCurrentValue('rustdoc-item-declarations') === "false";
var showItemDeclarations = getCurrentValue('rustdoc-item-declarations') === "false";
function buildToggleWrapper(e) {
if (hasClass(e, 'autohide')) {
var wrap = e.previousElementSibling;
Expand Down Expand Up @@ -2117,7 +2117,7 @@
if (hasClass(e, "type-decl")) {
fontSize = "20px";
otherMessage = ' Show declaration';
if (hideItemDeclarations === false) {
if (showItemDeclarations === false) {
extraClass = 'collapsed';
}
} else if (hasClass(e, "sub-variant")) {
Expand All @@ -2136,12 +2136,13 @@
extraClass = "marg-left";
}

e.parentNode.insertBefore(createToggle(otherMessage,
fontSize,
extraClass,
hideItemDeclarations),
e);
if (otherMessage.length > 0 && hideItemDeclarations === true) {
e.parentNode.insertBefore(
createToggle(otherMessage,
fontSize,
extraClass,
hasClass(e, "type-decl") === false || showItemDeclarations === true),
e);
if (hasClass(e, "type-decl") === true && showItemDeclarations === true) {
collapseDocs(e.previousSibling.childNodes[0], "toggle");
}
}
Expand Down

0 comments on commit f55e986

Please sign in to comment.