about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2022-06-28 14:56:24 -0700
committerMichael Howell <michael@notriddle.com>2022-06-28 17:29:37 -0700
commitcb8a7388fa0106793c3ea709528fa1408c7cf87b (patch)
tree6b23aef2bf2cce6b6b243a24fd4ba06a2ac2a7b2 /src/librustdoc/html
parentcec6988a07d30843f4b1c038fb6ff62f15d1a5e1 (diff)
downloadrust-cb8a7388fa0106793c3ea709528fa1408c7cf87b.tar.gz
rust-cb8a7388fa0106793c3ea709528fa1408c7cf87b.zip
rustdoc: fix keyboard shortcuts bug in settings menu
This commit fixes the keyboard shorts code to call localStorage every time a
key is pressed. This matters because you're supposed to be able to change a
setting and have it immediately take effect.
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/static/js/main.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js
index 2d2de7db0c9..789e7d298fa 100644
--- a/src/librustdoc/html/static/js/main.js
+++ b/src/librustdoc/html/static/js/main.js
@@ -412,9 +412,9 @@ function loadCss(cssFileName) {
         window.hidePopoverMenus();
     }
 
-    const disableShortcuts = getSettingValue("disable-shortcuts") === "true";
     function handleShortcut(ev) {
         // Don't interfere with browser shortcuts
+        const disableShortcuts = getSettingValue("disable-shortcuts") === "true";
         if (ev.ctrlKey || ev.altKey || ev.metaKey || disableShortcuts) {
             return;
         }