about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2023-01-17 17:22:05 -0700
committerMichael Howell <michael@notriddle.com>2023-01-17 17:22:05 -0700
commit6d7e2135f15eeb9a586ef97bb6a7744e5a936777 (patch)
treeb6fae3123ab66b537c227ad41abea51ef5667cde
parent3984bc5833db8bfb0acc522c9775383e4171f3de (diff)
downloadrust-6d7e2135f15eeb9a586ef97bb6a7744e5a936777.tar.gz
rust-6d7e2135f15eeb9a586ef97bb6a7744e5a936777.zip
rustdoc: remove function `handleClick` that's only used once
-rw-r--r--src/librustdoc/html/static/js/main.js11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js
index f52229d8095..4d604a21496 100644
--- a/src/librustdoc/html/static/js/main.js
+++ b/src/librustdoc/html/static/js/main.js
@@ -803,15 +803,10 @@ function loadCss(cssUrl) {
         }
     });
 
-    function handleClick(id, f) {
-        const elem = document.getElementById(id);
-        if (elem) {
-            elem.addEventListener("click", f);
-        }
+    const mainElem = document.getElementById(MAIN_ID);
+    if (mainElem) {
+        mainElem.addEventListener("click", hideSidebar);
     }
-    handleClick(MAIN_ID, () => {
-        hideSidebar();
-    });
 
     onEachLazy(document.querySelectorAll("a[href^='#']"), el => {
         // For clicks on internal links (<A> tags with a hash property), we expand the section we're