From f3cfcd04353d4f10bd2bac6708f706c857fea50a Mon Sep 17 00:00:00 2001 From: Thibaut Date: Sat, 8 Mar 2014 11:25:18 -0500 Subject: [PATCH] Add Sidebar#reset() --- assets/javascripts/views/sidebar/sidebar.coffee | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/javascripts/views/sidebar/sidebar.coffee b/assets/javascripts/views/sidebar/sidebar.coffee index 9b0caf72..7da53b47 100644 --- a/assets/javascripts/views/sidebar/sidebar.coffee +++ b/assets/javascripts/views/sidebar/sidebar.coffee @@ -51,6 +51,9 @@ class app.views.Sidebar extends app.View @show @results return + reset: -> + @showDocList true + saveScrollPosition: -> if @view is @docList @scrollTop = @el.scrollTop @@ -75,7 +78,7 @@ class app.views.Sidebar extends app.View onClick: (event) => if event.target.hasAttribute? 'data-reset-list' $.stopEvent(event) - @showDocList true + @reset() return onGlobalClick: (event) => @@ -87,10 +90,10 @@ class app.views.Sidebar extends app.View return onAltR: => - @showDocList true + @reset() return onEscape: => - @showDocList true + @reset() @scrollToTop() return