rustdoc: fix Ctrl-Click on help and settings links

This commit is contained in:
Michael Howell 2022-10-15 11:45:27 -07:00
parent ae4ad9adb6
commit 6f59981a7a

View File

@ -201,6 +201,9 @@ function loadCss(cssFileName) {
}
getSettingsButton().onclick = event => {
if (event.ctrlKey || event.altKey || event.metaKey) {
return;
}
addClass(getSettingsButton(), "rotate");
event.preventDefault();
// Sending request for the CSS and the JS files at the same time so it will
@ -951,7 +954,11 @@ function loadCss(cssFileName) {
} else {
document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click", event => {
const target = event.target;
if (target.tagName !== "A" || target.parentElement.id !== HELP_BUTTON_ID) {
if (target.tagName !== "A" ||
target.parentElement.id !== HELP_BUTTON_ID ||
event.ctrlKey ||
event.altKey ||
event.metaKey) {
return;
}
event.preventDefault();