History

Add forward slash as keyboard shortcut to focus the search field

Closes #542.

Thibaut Courouble committed 9 years ago

Commit 06cf1181 parent bd2224b2 files · +5 −1Browse files

Unified · Split

2 files
  1. assets/javascripts/app/shortcuts.coffee +4 −0
  2. assets/javascripts/templates/pages/help_tmpl.coffee +1 −1
assets/javascripts/app/shortcuts.coffee+4−0
@@ -76,6 +76,10 @@ class app.Shortcuts · 75 unmodified lines
76 @trigger 'down'76 @trigger 'down'
77 @showTip?()77 @showTip?()
78 false78 false
79 when 191
80 unless event.target.form
81 @trigger 'typing'
82 false
79 83
80 handleKeydownSuperEvent: (event) ->84 handleKeydownSuperEvent: (event) ->
81 switch event.which85 switch event.which
assets/javascripts/templates/pages/help_tmpl.coffee+1−1
@@ -107,7 +107,7 @@ app.templates.helpPage = """ · 106 unmodified lines
107 <dd class="_shortcuts-dd">Show this page107 <dd class="_shortcuts-dd">Show this page
108 </dl>108 </dl>
109 <p class="_note">109 <p class="_note">
110 <strong>Tip:</strong> If the cursor is no longer in the search field, press backspace or110 <strong>Tip:</strong> If the cursor is no longer in the search field, press <code class="_label">/</code> or
111 continue to type and it will refocus the search field and start showing new results.111 continue to type and it will refocus the search field and start showing new results.
112 112
113 <h2 class="_lined-heading" id="abbreviations">Abbreviations</h2>113 <h2 class="_lined-heading" id="abbreviations">Abbreviations</h2>