about summary refs log tree commit diff
path: root/src/librustdoc/html/static/js/scrape-examples.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustdoc/html/static/js/scrape-examples.js')
-rw-r--r--src/librustdoc/html/static/js/scrape-examples.js6
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');