diff options
| author | Will Crichton <wcrichto@cs.stanford.edu> | 2022-01-27 17:00:31 -0800 |
|---|---|---|
| committer | Will Crichton <wcrichto@cs.stanford.edu> | 2022-03-27 18:11:50 -0700 |
| commit | ae5d0cbe74a07baef9eb92dde82b28feea8961cd (patch) | |
| tree | 1edfc7666057d49e7d77b35f19a9fe86627d438f /src/librustdoc/html/static/js/scrape-examples.js | |
| parent | f1e3e2c366b05f232c6b2225af7fc155925029df (diff) | |
| download | rust-ae5d0cbe74a07baef9eb92dde82b28feea8961cd.tar.gz rust-ae5d0cbe74a07baef9eb92dde82b28feea8961cd.zip | |
Improve alignment of additional scraped examples, add scrape examples help page
Diffstat (limited to 'src/librustdoc/html/static/js/scrape-examples.js')
| -rw-r--r-- | src/librustdoc/html/static/js/scrape-examples.js | 6 |
1 files changed, 4 insertions, 2 deletions
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 <details> 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'); |
