Skip to content

Commit 6f59981

Browse files
committed
rustdoc: fix Ctrl-Click on help and settings links
1 parent ae4ad9a commit 6f59981

File tree

1 file changed

+8
-1
lines changed
  • src/librustdoc/html/static/js

1 file changed

+8
-1
lines changed

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,9 @@ function loadCss(cssFileName) {
201201
}
202202

203203
getSettingsButton().onclick = event => {
204+
if (event.ctrlKey || event.altKey || event.metaKey) {
205+
return;
206+
}
204207
addClass(getSettingsButton(), "rotate");
205208
event.preventDefault();
206209
// Sending request for the CSS and the JS files at the same time so it will
@@ -951,7 +954,11 @@ function loadCss(cssFileName) {
951954
} else {
952955
document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click", event => {
953956
const target = event.target;
954-
if (target.tagName !== "A" || target.parentElement.id !== HELP_BUTTON_ID) {
957+
if (target.tagName !== "A" ||
958+
target.parentElement.id !== HELP_BUTTON_ID ||
959+
event.ctrlKey ||
960+
event.altKey ||
961+
event.metaKey) {
955962
return;
956963
}
957964
event.preventDefault();

0 commit comments

Comments
 (0)