diff --git a/assets/javascripts/app/app.coffee b/assets/javascripts/app/app.coffee index 3a8e2b62..e90f1d61 100644 --- a/assets/javascripts/app/app.coffee +++ b/assets/javascripts/app/app.coffee @@ -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: -> diff --git a/assets/javascripts/app/appcache.coffee b/assets/javascripts/app/appcache.coffee index d2606ab1..8ad83904 100644 --- a/assets/javascripts/app/appcache.coffee +++ b/assets/javascripts/app/appcache.coffee @@ -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 diff --git a/assets/javascripts/views/layout/document.coffee b/assets/javascripts/views/layout/document.coffee index 10feefd5..02b98c7a 100644 --- a/assets/javascripts/views/layout/document.coffee +++ b/assets/javascripts/views/layout/document.coffee @@ -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