diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-02-07 14:28:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-07 14:28:40 +0100 |
| commit | da8da5e061a72b73eb1499d46f5fde36575e610a (patch) | |
| tree | cdeba796114e90a4ea28642dcafe1b6be4f1675e /src | |
| parent | 064b787fc9c5074077d20d50387b91d12fc1e277 (diff) | |
| parent | 729e37da4dd68adbd42d3a91791d01b170be38e5 (diff) | |
| download | rust-da8da5e061a72b73eb1499d46f5fde36575e610a.tar.gz rust-da8da5e061a72b73eb1499d46f5fde36575e610a.zip | |
Rollup merge of #58150 - GuillaumeGomez:dont-apply-impl-collapse-rules-to-trait-impls, r=Manishearth
Don't apply impl block collapse rules to trait impls Fixes #58147. r? @QuietMisdreavus
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/static/main.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 5ea6cf6ddf8..d6c05de0df6 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -1935,9 +1935,9 @@ if (!DOMTokenList.prototype.remove) { }; } - function implHider(addOrRemove) { + function implHider(addOrRemove, fullHide) { return function(n) { - var is_method = hasClass(n, "method"); + var is_method = hasClass(n, "method") || fullHide; if (is_method || hasClass(n, "type")) { if (is_method === true) { if (addOrRemove) { @@ -1991,7 +1991,7 @@ if (!DOMTokenList.prototype.remove) { } } } else { - // we are collapsing the impl block + // we are collapsing the impl block(s). var parentElem = toggle.parentNode; relatedDoc = parentElem; @@ -2006,7 +2006,7 @@ if (!DOMTokenList.prototype.remove) { return; } - // Hide all functions, but not associated types/consts + // Hide all functions, but not associated types/consts. if (mode === "toggle") { if (hasClass(relatedDoc, "fns-now-collapsed") || @@ -2017,16 +2017,17 @@ if (!DOMTokenList.prototype.remove) { } } + var dontApplyBlockRule = toggle.parentNode.parentNode.id !== "main"; if (action === "show") { removeClass(relatedDoc, "fns-now-collapsed"); removeClass(docblock, "hidden-by-usual-hider"); - onEachLazy(toggle.childNodes, adjustToggle(false)); - onEachLazy(relatedDoc.childNodes, implHider(false)); + onEachLazy(toggle.childNodes, adjustToggle(false, dontApplyBlockRule)); + onEachLazy(relatedDoc.childNodes, implHider(false, dontApplyBlockRule)); } else if (action === "hide") { addClass(relatedDoc, "fns-now-collapsed"); addClass(docblock, "hidden-by-usual-hider"); - onEachLazy(toggle.childNodes, adjustToggle(true)); - onEachLazy(relatedDoc.childNodes, implHider(true)); + onEachLazy(toggle.childNodes, adjustToggle(true, dontApplyBlockRule); + onEachLazy(relatedDoc.childNodes, implHider(true, dontApplyBlockRule)); } } } |
