mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 08:36:03 +00:00
Don't generate '[+]'/'[-]' on 'empty' traits
This commit is contained in:
parent
e2746d8700
commit
a628543891
@ -1776,22 +1776,33 @@
|
|||||||
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkIfThereAreMethods(elems) {
|
||||||
|
var areThereMethods = false;
|
||||||
|
|
||||||
|
onEach(elems, function(e) {
|
||||||
|
if (hasClass(e, "method")) {
|
||||||
|
areThereMethods = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return areThereMethods;
|
||||||
|
}
|
||||||
|
|
||||||
var toggle = document.createElement('a');
|
var toggle = document.createElement('a');
|
||||||
toggle.href = 'javascript:void(0)';
|
toggle.href = 'javascript:void(0)';
|
||||||
toggle.className = 'collapse-toggle';
|
toggle.className = 'collapse-toggle';
|
||||||
toggle.innerHTML = "[<span class='inner'>"+labelForToggleButton(false)+"</span>]";
|
toggle.innerHTML = "[<span class='inner'>" + labelForToggleButton(false) + "</span>]";
|
||||||
|
|
||||||
var func = function(e) {
|
var func = function(e) {
|
||||||
var next = e.nextElementSibling;
|
var next = e.nextElementSibling;
|
||||||
if (!next) {
|
if (!next) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (hasClass(next, 'docblock') ||
|
if (checkIfThereAreMethods(next.childNodes) &&
|
||||||
(hasClass(next, 'stability') &&
|
(hasClass(next, 'docblock') ||
|
||||||
hasClass(next.nextElementSibling, 'docblock'))) {
|
hasClass(e, 'impl') ||
|
||||||
insertAfter(toggle.cloneNode(true), e.childNodes[e.childNodes.length - 1]);
|
(hasClass(next, 'stability') &&
|
||||||
}
|
hasClass(next.nextElementSibling, 'docblock')))) {
|
||||||
if (hasClass(e, 'impl')) {
|
|
||||||
insertAfter(toggle.cloneNode(true), e.childNodes[e.childNodes.length - 1]);
|
insertAfter(toggle.cloneNode(true), e.childNodes[e.childNodes.length - 1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user