Don't autofocus search input on Android/iOS

pull/605/head
Thibaut Courouble 8 years ago
parent 6cd27c2ac1
commit 63bb8cd1e1

@ -336,11 +336,21 @@ $.popup = (value) ->
window.open value.href or value, '_blank'
return
isMac = null
$.isMac = ->
navigator.userAgent?.indexOf('Mac') >= 0
isMac ?= navigator.userAgent?.indexOf('Mac') >= 0
isIE = null
$.isIE = ->
navigator.userAgent?.indexOf('MSIE') >= 0 || navigator.userAgent?.indexOf('rv:11.0') >= 0
isIE ?= navigator.userAgent?.indexOf('MSIE') >= 0 || navigator.userAgent?.indexOf('rv:11.0') >= 0
isAndroid = null
$.isAndroid = ->
isAndroid ?= navigator.userAgent?.indexOf('Android') >= 0
isIOS = null
$.isIOS = ->
isIOS ?= navigator.userAgent?.indexOf('iPhone') >= 0 || navigator.userAgent?.indexOf('iPad') >= 0
HIGHLIGHT_DEFAULTS =
className: 'highlight'

@ -41,7 +41,7 @@ class app.views.Search extends app.View
return
autoFocus: =>
unless app.isMobile()
unless app.isMobile() or $.isAndroid() or $.isIOS()
@input.focus() unless document.activeElement is @input
return

Loading…
Cancel
Save