Preserve path when reloading the app

Fixes #849.
pull/929/head
Thibaut Courouble 6 years ago
parent f562c2face
commit a8a97e0198

@ -157,10 +157,17 @@
new app.views.Updates()
@updateChecker = new app.UpdateChecker()
reboot: ->
if location.pathname isnt '/'
window.location = "/##{location.pathname}"
else
window.location = '/'
return
reload: ->
@docs.clearCache()
@disabledDocs.clearCache()
if @appCache then @appCache.reload() else window.location = '/'
if @appCache then @appCache.reload() else @reboot()
return
reset: ->

@ -27,7 +27,11 @@ class app.AppCache
return
reload: ->
$.on @cache, 'updateready noupdate error', -> window.location = '/'
$.on @cache, 'updateready noupdate error', ->
if location.pathname isnt '/'
window.location = "/##{location.pathname}"
else
window.location = '/'
@notifyUpdate = false
@notifyProgress = true
try @cache.update() catch

@ -77,7 +77,7 @@ class app.views.Document extends app.View
switch target.getAttribute('data-behavior')
when 'back' then history.back()
when 'reload' then window.location.reload()
when 'reboot' then window.location = '/'
when 'reboot' then app.reboot()
when 'hard-reload' then app.reload()
when 'reset' then app.reset() if confirm('Are you sure you want to reset DevDocs?')
return

Loading…
Cancel
Save