Skip to content

Commit

Permalink
Rollup merge of #107014 - notriddle:notriddle/js-cleanup, r=Guillaume…
Browse files Browse the repository at this point in the history
…Gomez

rustdoc: remove deprecated / unused code from main.js
  • Loading branch information
Dylan-DPC committed Jan 18, 2023
2 parents 1ff4a12 + 708b529 commit 43b1e73
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -945,7 +940,7 @@ function loadCss(cssUrl) {
return;
}
if (!this.NOTABLE_FORCE_VISIBLE &&
!elemIsInParent(event.relatedTarget, window.CURRENT_NOTABLE_ELEMENT)) {
!elemIsInParent(ev.relatedTarget, window.CURRENT_NOTABLE_ELEMENT)) {
hideNotable(true);
}
};
Expand Down

0 comments on commit 43b1e73

Please sign in to comment.