Always reset sidebar list on escape

pull/15/head
Thibaut 11 years ago
parent 2b20c09f17
commit 8171fe658b

@ -9,7 +9,6 @@ class app.views.ListFold extends app.View
@shortcuts:
left: 'onLeft'
right: 'onRight'
escape: 'reset'
constructor: (@el) -> super
@ -32,7 +31,7 @@ class app.views.ListFold extends app.View
@open el
return
reset: =>
reset: ->
while el = @findByClass @constructor.activeClass
@close el
return

@ -35,8 +35,9 @@ class app.views.Sidebar extends app.View
@restoreScrollPosition()
return
showDocList: =>
showDocList: (reset) =>
@show @docList
@docList.reset() if reset is true
return
showDocPicker: =>
@ -71,8 +72,7 @@ class app.views.Sidebar extends app.View
onClick: (event) =>
if event.target.hasAttribute? 'data-reset-list'
$.stopEvent(event)
@showDocList()
@docList.reset()
@showDocList true
return
onGlobalClick: (event) =>
@ -84,6 +84,6 @@ class app.views.Sidebar extends app.View
return
onEscape: =>
@showDocList()
@showDocList true
@scrollToTop()
return

Loading…
Cancel
Save