Skip to content

Commit 8b20e9b

Browse files
Add shortcut for theme picker menu
1 parent f7801d6 commit 8b20e9b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/librustdoc/html/static/main.js

+10
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,15 @@ function defocusSearchBar() {
415415
displayHelp(true, ev);
416416
break;
417417

418+
case "t":
419+
case "T":
420+
displayHelp(false, ev);
421+
ev.preventDefault();
422+
var themePicker = getThemePickerElement();
423+
themePicker.click();
424+
themePicker.focus();
425+
break;
426+
418427
default:
419428
var themePicker = getThemePickerElement();
420429
if (themePicker.parentNode.contains(ev.target)) {
@@ -2852,6 +2861,7 @@ function defocusSearchBar() {
28522861
var shortcuts = [
28532862
["?", "Show this help dialog"],
28542863
["S", "Focus the search field"],
2864+
["T", "Focus the theme picker menu"],
28552865
["↑", "Move up in search results"],
28562866
["↓", "Move down in search results"],
28572867
["↹", "Switch tab"],

0 commit comments

Comments
 (0)