Improve keyboard navigation on mobile

Rel: #638
pull/647/head
Thibaut Courouble 8 years ago
parent 9adf4e2d9f
commit 69ffa7babe

@ -7,6 +7,9 @@ class app.views.Mobile extends app.View
sidebar: '._sidebar' sidebar: '._sidebar'
docPicker: '._settings ._sidebar' docPicker: '._settings ._sidebar'
@shortcuts:
escape: 'onEscape'
@routes: @routes:
after: 'afterRoute' after: 'afterRoute'
@ -129,6 +132,9 @@ class app.views.Mobile extends app.View
onTapSearch: => onTapSearch: =>
window.scrollTo 0, 0 window.scrollTo 0, 0
onEscape: =>
@hideSidebar()
afterRoute: (route) => afterRoute: (route) =>
@hideSidebar() @hideSidebar()

@ -18,7 +18,7 @@ class app.views.DocList extends app.View
init: -> init: ->
@lists = {} @lists = {}
@addSubview @listFocus = new app.views.ListFocus @el unless app.isMobile() @addSubview @listFocus = new app.views.ListFocus @el
@addSubview @listFold = new app.views.ListFold @el @addSubview @listFold = new app.views.ListFold @el
@addSubview @listSelect = new app.views.ListSelect @el @addSubview @listSelect = new app.views.ListSelect @el

@ -15,7 +15,7 @@ class app.views.Results extends app.View
return return
init: -> init: ->
@addSubview @listFocus = new app.views.ListFocus @el unless app.isMobile() @addSubview @listFocus = new app.views.ListFocus @el
@addSubview @listSelect = new app.views.ListSelect @el @addSubview @listSelect = new app.views.ListSelect @el
@search @search
@ -42,7 +42,7 @@ class app.views.Results extends app.View
return return
focusFirst: -> focusFirst: ->
@listFocus?.focusOnNextFrame @el.firstElementChild @listFocus?.focusOnNextFrame @el.firstElementChild unless app.isMobile()
return return
openFirst: -> openFirst: ->

Loading…
Cancel
Save