Skip to content

Commit 76a590d

Browse files
committed
rustdoc: add back [-]/[+] toggle links for unstable-methods
1 parent 6b29a7d commit 76a590d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/librustdoc/html/static/main.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,9 @@
823823
$(document).on("click", ".collapse-toggle", function() {
824824
var toggle = $(this);
825825
var relatedDoc = toggle.parent().next();
826+
if (relatedDoc.is(".stability")) {
827+
relatedDoc = relatedDoc.next();
828+
}
826829
if (relatedDoc.is(".docblock")) {
827830
if (relatedDoc.is(":visible")) {
828831
relatedDoc.slideUp({duration:'fast', easing:'linear'});
@@ -843,9 +846,10 @@
843846
.html("[<span class='inner'>-</span>]");
844847

845848
$(".method").each(function() {
846-
if ($(this).next().is(".docblock")) {
847-
$(this).children().first().after(toggle.clone());
848-
}
849+
if ($(this).next().is(".docblock") ||
850+
($(this).next().is(".stability") && $(this).next().next().is(".docblock"))) {
851+
$(this).children().first().after(toggle.clone());
852+
}
849853
});
850854

851855
var mainToggle =

0 commit comments

Comments
 (0)