Press esc twice to reset to root page in single doc mode

pull/90/head
Thibaut 11 years ago
parent 7e09b44468
commit cf17f74595

@ -88,7 +88,7 @@ app.templates.helpPage = """
<dd class="_shortcuts-dd">Search on Google <dd class="_shortcuts-dd">Search on Google
<dt class="_shortcuts-dt"> <dt class="_shortcuts-dt">
<code class="_shortcut-code">escape</code> <code class="_shortcut-code">escape</code>
<dd class="_shortcuts-dd">Reset <dd class="_shortcuts-dd">Reset<br>(press twice in single doc mode)
<dt class="_shortcuts-dt"> <dt class="_shortcuts-dt">
<code class="_shortcut-code">?</code> <code class="_shortcut-code">?</code>
<dd class="_shortcuts-dd">Show this page <dd class="_shortcuts-dd">Show this page

@ -24,7 +24,12 @@ class app.views.Document extends app.View
app.router.show '/help#shortcuts' app.router.show '/help#shortcuts'
onEscape: -> onEscape: ->
app.router.show if app.isSingleDoc() then app.doc.fullPath() else '/' path = if !app.isSingleDoc() or location.pathname is app.doc.fullPath()
'/'
else
app.doc.fullPath()
app.router.show(path)
onBack: -> onBack: ->
history.back() history.back()

Loading…
Cancel
Save