From ae5d0cbe74a07baef9eb92dde82b28feea8961cd Mon Sep 17 00:00:00 2001 From: Will Crichton Date: Thu, 27 Jan 2022 17:00:31 -0800 Subject: Improve alignment of additional scraped examples, add scrape examples help page --- src/librustdoc/html/static/js/scrape-examples.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/librustdoc/html/static/js/scrape-examples.js') diff --git a/src/librustdoc/html/static/js/scrape-examples.js b/src/librustdoc/html/static/js/scrape-examples.js index 383ae001bc2..a28fb461729 100644 --- a/src/librustdoc/html/static/js/scrape-examples.js +++ b/src/librustdoc/html/static/js/scrape-examples.js @@ -84,8 +84,10 @@ onEach(document.querySelectorAll('.more-examples-toggle'), function(toggle) { // Allow users to click the left border of the
section to close it, // since the section can be large and finding the [+] button is annoying. - toggle.querySelector('.toggle-line').addEventListener('click', function() { - toggle.open = false; + toggle.querySelectorAll('.toggle-line, .hide-more').forEach(button => { + button.addEventListener('click', function() { + toggle.open = false; + }); }); var moreExamples = toggle.querySelectorAll('.scraped-example'); -- cgit 1.4.1-3-g733a5