Skip to content

Commit 6d7e213

Browse files
committed
rustdoc: remove function handleClick that's only used once
1 parent 3984bc5 commit 6d7e213

File tree

1 file changed

+3
-8
lines changed
  • src/librustdoc/html/static/js

1 file changed

+3
-8
lines changed

src/librustdoc/html/static/js/main.js

+3-8
Original file line numberDiff line numberDiff line change
@@ -803,15 +803,10 @@ function loadCss(cssUrl) {
803803
}
804804
});
805805

806-
function handleClick(id, f) {
807-
const elem = document.getElementById(id);
808-
if (elem) {
809-
elem.addEventListener("click", f);
810-
}
806+
const mainElem = document.getElementById(MAIN_ID);
807+
if (mainElem) {
808+
mainElem.addEventListener("click", hideSidebar);
811809
}
812-
handleClick(MAIN_ID, () => {
813-
hideSidebar();
814-
});
815810

816811
onEachLazy(document.querySelectorAll("a[href^='#']"), el => {
817812
// For clicks on internal links (<A> tags with a hash property), we expand the section we're

0 commit comments

Comments
 (0)