We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
handleClick
1 parent 3984bc5 commit 6d7e213Copy full SHA for 6d7e213
src/librustdoc/html/static/js/main.js
@@ -803,15 +803,10 @@ function loadCss(cssUrl) {
803
}
804
});
805
806
- function handleClick(id, f) {
807
- const elem = document.getElementById(id);
808
- if (elem) {
809
- elem.addEventListener("click", f);
810
- }
+ const mainElem = document.getElementById(MAIN_ID);
+ if (mainElem) {
+ mainElem.addEventListener("click", hideSidebar);
811
812
- handleClick(MAIN_ID, () => {
813
- hideSidebar();
814
- });
815
816
onEachLazy(document.querySelectorAll("a[href^='#']"), el => {
817
// For clicks on internal links (<A> tags with a hash property), we expand the section we're
0 commit comments