History

Focus the search field when typing '/' or alphanumeric characters on mobile

Thibaut Courouble committed 9 years ago

Commit 9adf4e21 parent 48d85f11 file · +3 −4Browse files

Showing the changes to assets/javascripts (1 of 1 file). Show all

Unified · Split

assets/javascripts/views/search/search.coffee+3−4
@@ -14,7 +14,7 @@ class app.views.Search extends app.View · 13 unmodified lines
1414 submit: 'onSubmit'
1515
1616 @shortcuts:
17− typing: 'autoFocus'
17+ typing: 'focus'
1818 altG: 'google'
1919 altS: 'stackoverflow'
2020
@@ -34,9 +34,8 @@ class app.views.Search extends app.View · 13 unmodified lines
3434 $.on window, 'focus', @autoFocus
3535 return
3636
37− focus: ->
38− @delay =>
39− @input.focus() unless document.activeElement is @input
37+ focus: =>
38+ @input.focus() unless document.activeElement is @input
4039 return
4140
4241 autoFocus: =>