diff --git a/assets/javascripts/views/layout/mobile.coffee b/assets/javascripts/views/layout/mobile.coffee index 041f8c48..ae6f9940 100644 --- a/assets/javascripts/views/layout/mobile.coffee +++ b/assets/javascripts/views/layout/mobile.coffee @@ -7,6 +7,9 @@ class app.views.Mobile extends app.View sidebar: '._sidebar' docPicker: '._settings ._sidebar' + @shortcuts: + escape: 'onEscape' + @routes: after: 'afterRoute' @@ -129,6 +132,9 @@ class app.views.Mobile extends app.View onTapSearch: => window.scrollTo 0, 0 + onEscape: => + @hideSidebar() + afterRoute: (route) => @hideSidebar() diff --git a/assets/javascripts/views/sidebar/doc_list.coffee b/assets/javascripts/views/sidebar/doc_list.coffee index d9823a10..2f132109 100644 --- a/assets/javascripts/views/sidebar/doc_list.coffee +++ b/assets/javascripts/views/sidebar/doc_list.coffee @@ -18,7 +18,7 @@ class app.views.DocList extends app.View init: -> @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 @listSelect = new app.views.ListSelect @el diff --git a/assets/javascripts/views/sidebar/results.coffee b/assets/javascripts/views/sidebar/results.coffee index 0793c452..c75776eb 100644 --- a/assets/javascripts/views/sidebar/results.coffee +++ b/assets/javascripts/views/sidebar/results.coffee @@ -15,7 +15,7 @@ class app.views.Results extends app.View return 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 @search @@ -42,7 +42,7 @@ class app.views.Results extends app.View return focusFirst: -> - @listFocus?.focusOnNextFrame @el.firstElementChild + @listFocus?.focusOnNextFrame @el.firstElementChild unless app.isMobile() return openFirst: ->