Skip to content

Commit

Permalink
Rollup merge of rust-lang#24717 - liigo:add-back-toggle-links, r=alex…
Browse files Browse the repository at this point in the history
…crichton

r? @alexcrichton (since you added `.stability` warning messages)
  • Loading branch information
Manishearth committed Apr 24, 2015
2 parents f1db259 + 76a590d commit af6ec32
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,9 @@
$(document).on("click", ".collapse-toggle", function() {
var toggle = $(this);
var relatedDoc = toggle.parent().next();
if (relatedDoc.is(".stability")) {
relatedDoc = relatedDoc.next();
}
if (relatedDoc.is(".docblock")) {
if (relatedDoc.is(":visible")) {
relatedDoc.slideUp({duration:'fast', easing:'linear'});
Expand All @@ -848,9 +851,10 @@
.html("[<span class='inner'>-</span>]");

$(".method").each(function() {
if ($(this).next().is(".docblock")) {
$(this).children().first().after(toggle.clone());
}
if ($(this).next().is(".docblock") ||
($(this).next().is(".stability") && $(this).next().next().is(".docblock"))) {
$(this).children().first().after(toggle.clone());
}
});

var mainToggle =
Expand Down

0 comments on commit af6ec32

Please sign in to comment.