History

Improve keyboard usability of doc picker

Thibaut committed 11 years ago

Commit 44a3b451 parent b5f2ba52 files · +7 −0Browse files

Showing the changes to assets/javascripts (1 of 2 files). Show all

Unified · Split

assets/javascripts/views/sidebar/doc_picker.coffee+6−0
@@ -13,13 +13,16 @@ class app.views.DocPicker extends app.View · 12 unmodified lines
1313 activate: ->
1414 if super
1515 @render()
16+ @findByTag('input').focus()
1617 app.appCache?.on 'progress', @onAppCacheProgress
18+ $.on @el, 'focus', @onFocus, true
1719 return
1820
1921 deactivate: ->
2022 if super
2123 @empty()
2224 app.appCache?.off 'progress', @onAppCacheProgress
25+ $.off @el, 'focus', @onFocus, true
2326 return
2427
2528 render: ->
@@ -58,6 +61,9 @@ class app.views.DocPicker extends app.View · 32 unmodified lines
5861 @save()
5962 return
6063
64+ onFocus: (event) ->
65+ $.scrollTo event.target.parentNode, null, 'continuous', bottomGap: 2
66+
6167 onEnter: =>
6268 @save()
6369 return