Skip to content

Commit af6ec32

Browse files
committed
Rollup merge of #24717 - liigo:add-back-toggle-links, r=alexcrichton
r? @alexcrichton (since you added `.stability` warning messages)
2 parents f1db259 + 76a590d commit af6ec32

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
@@ -828,6 +828,9 @@
828828
$(document).on("click", ".collapse-toggle", function() {
829829
var toggle = $(this);
830830
var relatedDoc = toggle.parent().next();
831+
if (relatedDoc.is(".stability")) {
832+
relatedDoc = relatedDoc.next();
833+
}
831834
if (relatedDoc.is(".docblock")) {
832835
if (relatedDoc.is(":visible")) {
833836
relatedDoc.slideUp({duration:'fast', easing:'linear'});
@@ -848,9 +851,10 @@
848851
.html("[<span class='inner'>-</span>]");
849852

850853
$(".method").each(function() {
851-
if ($(this).next().is(".docblock")) {
852-
$(this).children().first().after(toggle.clone());
853-
}
854+
if ($(this).next().is(".docblock") ||
855+
($(this).next().is(".stability") && $(this).next().next().is(".docblock"))) {
856+
$(this).children().first().after(toggle.clone());
857+
}
854858
});
855859

856860
var mainToggle =

0 commit comments

Comments
 (0)