Explorar o código

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

Rel: #638
Thibaut Courouble %!s(int64=8) %!d(string=hai) anos
pai
achega
9adf4e2d9f
Modificáronse 1 ficheiros con 3 adicións e 4 borrados
  1. 3 4
      assets/javascripts/views/search/search.coffee

+ 3 - 4
assets/javascripts/views/search/search.coffee

@@ -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: =>