Selaa lähdekoodia

Add forward slash as keyboard shortcut to focus the search field

Closes #542.
Thibaut Courouble 9 vuotta sitten
vanhempi
commit
06cf118786

+ 4 - 0
assets/javascripts/app/shortcuts.coffee

@@ -76,6 +76,10 @@ class app.Shortcuts
         @trigger 'down'
         @showTip?()
         false
+      when 191
+        unless event.target.form
+          @trigger 'typing'
+          false
 
   handleKeydownSuperEvent: (event) ->
     switch event.which

+ 1 - 1
assets/javascripts/templates/pages/help_tmpl.coffee

@@ -107,7 +107,7 @@ app.templates.helpPage = """
     <dd class="_shortcuts-dd">Show this page
   </dl>
   <p class="_note">
-    <strong>Tip:</strong> If the cursor is no longer in the search field, press backspace or
+    <strong>Tip:</strong> If the cursor is no longer in the search field, press <code class="_label">/</code> or
     continue to type and it will refocus the search field and start showing new results.
 
   <h2 class="_lined-heading" id="abbreviations">Abbreviations</h2>