Skip to content

Commit 43b1e73

Browse files
authored
Rollup merge of #107014 - notriddle:notriddle/js-cleanup, r=GuillaumeGomez
rustdoc: remove deprecated / unused code from main.js
2 parents 1ff4a12 + 708b529 commit 43b1e73

File tree

1 file changed

+4
-9
lines changed
  • src/librustdoc/html/static/js

1 file changed

+4
-9
lines changed

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

+4-9
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
@@ -945,7 +940,7 @@ function loadCss(cssUrl) {
945940
return;
946941
}
947942
if (!this.NOTABLE_FORCE_VISIBLE &&
948-
!elemIsInParent(event.relatedTarget, window.CURRENT_NOTABLE_ELEMENT)) {
943+
!elemIsInParent(ev.relatedTarget, window.CURRENT_NOTABLE_ELEMENT)) {
949944
hideNotable(true);
950945
}
951946
};

0 commit comments

Comments
 (0)