mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Focus the search field when typing '/' or alphanumeric characters on mobile
Rel: #638
This commit is contained in:
parent
48d85f1124
commit
9adf4e2d9f
1 changed files with 3 additions and 4 deletions
|
@ -14,7 +14,7 @@ class app.views.Search extends app.View
|
|||
submit: 'onSubmit'
|
||||
|
||||
@shortcuts:
|
||||
typing: 'autoFocus'
|
||||
typing: 'focus'
|
||||
altG: 'google'
|
||||
altS: 'stackoverflow'
|
||||
|
||||
|
@ -34,9 +34,8 @@ class app.views.Search extends app.View
|
|||
$.on window, 'focus', @autoFocus
|
||||
return
|
||||
|
||||
focus: ->
|
||||
@delay =>
|
||||
@input.focus() unless document.activeElement is @input
|
||||
focus: =>
|
||||
@input.focus() unless document.activeElement is @input
|
||||
return
|
||||
|
||||
autoFocus: =>
|
||||
|
|
Loading…
Reference in a new issue