Skip to content

rustdoc: remove deprecated / unused code from main.js #107014

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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