From cb8a7388fa0106793c3ea709528fa1408c7cf87b Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Tue, 28 Jun 2022 14:56:24 -0700 Subject: 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. --- src/librustdoc/html/static/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/librustdoc/html') 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; } -- cgit 1.4.1-3-g733a5