diff --git a/assets/javascripts/app/shortcuts.coffee b/assets/javascripts/app/shortcuts.coffee index d3933ea5..0a9400df 100644 --- a/assets/javascripts/app/shortcuts.coffee +++ b/assets/javascripts/app/shortcuts.coffee @@ -104,6 +104,9 @@ class app.Shortcuts when 71 @trigger 'altG' false + when 82 + @trigger 'altR' + false handleKeypressEvent: (event) -> if event.which is 63 and not event.target.value diff --git a/assets/javascripts/templates/pages/help_tmpl.coffee b/assets/javascripts/templates/pages/help_tmpl.coffee index 9d7ff17b..9d7662bb 100644 --- a/assets/javascripts/templates/pages/help_tmpl.coffee +++ b/assets/javascripts/templates/pages/help_tmpl.coffee @@ -77,6 +77,9 @@ app.templates.helpPage = """

Misc

+
+ Alt + r +
Reveal current page in sidebar
Alt + g
Search on Google diff --git a/assets/javascripts/templates/pages/news_tmpl.coffee b/assets/javascripts/templates/pages/news_tmpl.coffee index 7d10a532..9651ade4 100644 --- a/assets/javascripts/templates/pages/news_tmpl.coffee +++ b/assets/javascripts/templates/pages/news_tmpl.coffee @@ -25,7 +25,8 @@ newsItem = (date, news) -> app.news = [ [ 1389484800000, # January 12, 2013 - """ Added Alt + g shortcut for searching on Google. """ + """ Added Alt + g shortcut for searching on Google. """, + """ Added Alt + r shortcut for revealing the current page in the sidebar. """ ], [ 1386979200000, # December 14, 2013 """ New PostgreSQL documentation """ diff --git a/assets/javascripts/views/sidebar/sidebar.coffee b/assets/javascripts/views/sidebar/sidebar.coffee index f731e4ce..f0d6a7a5 100644 --- a/assets/javascripts/views/sidebar/sidebar.coffee +++ b/assets/javascripts/views/sidebar/sidebar.coffee @@ -6,6 +6,7 @@ class app.views.Sidebar extends app.View click: 'onClick' @shortcuts: + altR: 'onAltR' escape: 'onEscape' init: -> @@ -85,6 +86,10 @@ class app.views.Sidebar extends app.View @showDocList() unless $.hasChild @el, event.target return + onAltR: => + @showDocList true + return + onEscape: => @showDocList true @scrollToTop()