Rollup merge of #65656 - GuillaumeGomez:option-disable-shortcut, r=Dylan-DPC
Add option to disable keyboard shortcuts in docs Fixes #65211. r? @Manishearth
This commit is contained in:
commit
88e3ae2eb4
@ -1241,6 +1241,7 @@ fn settings(root_path: &str, suffix: &str) -> String {
|
||||
("go-to-only-result", "Directly go to item in search if there is only one result",
|
||||
false),
|
||||
("line-numbers", "Show line numbers on code examples", false),
|
||||
("disable-shortcuts", "Disable keyboard shortcuts", false),
|
||||
];
|
||||
format!(
|
||||
"<h1 class='fqn'>\
|
||||
|
@ -79,6 +79,7 @@ function getSearchElement() {
|
||||
"derive",
|
||||
"traitalias"];
|
||||
|
||||
var disableShortcuts = getCurrentValue("rustdoc-disable-shortcuts") !== "true";
|
||||
var search_input = getSearchInput();
|
||||
|
||||
// On the search screen, so you remain on the last tab you opened.
|
||||
@ -294,7 +295,7 @@ function getSearchElement() {
|
||||
|
||||
function handleShortcut(ev) {
|
||||
// Don't interfere with browser shortcuts
|
||||
if (ev.ctrlKey || ev.altKey || ev.metaKey) {
|
||||
if (ev.ctrlKey || ev.altKey || ev.metaKey || disableShortcuts === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user