From 76a590d0ef15506ed805a943b3a19ce65651903f Mon Sep 17 00:00:00 2001 From: Liigo Zhuang Date: Thu, 23 Apr 2015 01:32:59 +0800 Subject: [PATCH] rustdoc: add back [-]/[+] toggle links for unstable-methods --- src/librustdoc/html/static/main.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 0379c04be4d29..7e0b6813bc040 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -823,6 +823,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'}); @@ -843,9 +846,10 @@ .html("[-]"); $(".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 =