Skip to content

Commit

Permalink
Add shortcut for theme picker menu
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 5, 2020
1 parent f7801d6 commit 8b20e9b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,15 @@ function defocusSearchBar() {
displayHelp(true, ev);
break;

case "t":
case "T":
displayHelp(false, ev);
ev.preventDefault();
var themePicker = getThemePickerElement();
themePicker.click();
themePicker.focus();
break;

default:
var themePicker = getThemePickerElement();
if (themePicker.parentNode.contains(ev.target)) {
Expand Down Expand Up @@ -2852,6 +2861,7 @@ function defocusSearchBar() {
var shortcuts = [
["?", "Show this help dialog"],
["S", "Focus the search field"],
["T", "Focus the theme picker menu"],
["↑", "Move up in search results"],
["↓", "Move down in search results"],
["↹", "Switch tab"],
Expand Down

0 comments on commit 8b20e9b

Please sign in to comment.