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
This commit is contained in:
commit
da8da5e061
1 changed files with 9 additions and 8 deletions
|
@ -1935,9 +1935,9 @@ if (!DOMTokenList.prototype.remove) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function implHider(addOrRemove) {
|
function implHider(addOrRemove, fullHide) {
|
||||||
return function(n) {
|
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 || hasClass(n, "type")) {
|
||||||
if (is_method === true) {
|
if (is_method === true) {
|
||||||
if (addOrRemove) {
|
if (addOrRemove) {
|
||||||
|
@ -1991,7 +1991,7 @@ if (!DOMTokenList.prototype.remove) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// we are collapsing the impl block
|
// we are collapsing the impl block(s).
|
||||||
|
|
||||||
var parentElem = toggle.parentNode;
|
var parentElem = toggle.parentNode;
|
||||||
relatedDoc = parentElem;
|
relatedDoc = parentElem;
|
||||||
|
@ -2006,7 +2006,7 @@ if (!DOMTokenList.prototype.remove) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hide all functions, but not associated types/consts
|
// Hide all functions, but not associated types/consts.
|
||||||
|
|
||||||
if (mode === "toggle") {
|
if (mode === "toggle") {
|
||||||
if (hasClass(relatedDoc, "fns-now-collapsed") ||
|
if (hasClass(relatedDoc, "fns-now-collapsed") ||
|
||||||
|
@ -2017,16 +2017,17 @@ if (!DOMTokenList.prototype.remove) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var dontApplyBlockRule = toggle.parentNode.parentNode.id !== "main";
|
||||||
if (action === "show") {
|
if (action === "show") {
|
||||||
removeClass(relatedDoc, "fns-now-collapsed");
|
removeClass(relatedDoc, "fns-now-collapsed");
|
||||||
removeClass(docblock, "hidden-by-usual-hider");
|
removeClass(docblock, "hidden-by-usual-hider");
|
||||||
onEachLazy(toggle.childNodes, adjustToggle(false));
|
onEachLazy(toggle.childNodes, adjustToggle(false, dontApplyBlockRule));
|
||||||
onEachLazy(relatedDoc.childNodes, implHider(false));
|
onEachLazy(relatedDoc.childNodes, implHider(false, dontApplyBlockRule));
|
||||||
} else if (action === "hide") {
|
} else if (action === "hide") {
|
||||||
addClass(relatedDoc, "fns-now-collapsed");
|
addClass(relatedDoc, "fns-now-collapsed");
|
||||||
addClass(docblock, "hidden-by-usual-hider");
|
addClass(docblock, "hidden-by-usual-hider");
|
||||||
onEachLazy(toggle.childNodes, adjustToggle(true));
|
onEachLazy(toggle.childNodes, adjustToggle(true, dontApplyBlockRule);
|
||||||
onEachLazy(relatedDoc.childNodes, implHider(true));
|
onEachLazy(relatedDoc.childNodes, implHider(true, dontApplyBlockRule));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue