Fixes #849.
Unified · Split
| @@ -157,10 +157,17 @@ · 156 unmodified lines | |||
| 157 | new app.views.Updates() | 157 | new app.views.Updates() |
| 158 | @updateChecker = new app.UpdateChecker() | 158 | @updateChecker = new app.UpdateChecker() |
| 159 | 159 | ||
| 160 | reboot: -> | ||
| 161 | if location.pathname isnt '/' | ||
| 162 | window.location = "/##{location.pathname}" | ||
| 163 | else | ||
| 164 | window.location = '/' | ||
| 165 | return | ||
| 166 | |||
| 160 | reload: -> | 167 | reload: -> |
| 161 | @docs.clearCache() | 168 | @docs.clearCache() |
| 162 | @disabledDocs.clearCache() | 169 | @disabledDocs.clearCache() |
| 163 | if @appCache then @appCache.reload() else window.location = '/' | 170 | if @appCache then @appCache.reload() else @reboot() |
| 164 | return | 171 | return |
| 165 | 172 | ||
| 166 | reset: -> | 173 | reset: -> |
| @@ -27,7 +27,11 @@ class app.AppCache · 26 unmodified lines | |||
| 27 | return | 27 | return |
| 28 | 28 | ||
| 29 | reload: -> | 29 | reload: -> |
| 30 | $.on @cache, 'updateready noupdate error', -> window.location = '/' | 30 | $.on @cache, 'updateready noupdate error', -> |
| 31 | if location.pathname isnt '/' | ||
| 32 | window.location = "/##{location.pathname}" | ||
| 33 | else | ||
| 34 | window.location = '/' | ||
| 31 | @notifyUpdate = false | 35 | @notifyUpdate = false |
| 32 | @notifyProgress = true | 36 | @notifyProgress = true |
| 33 | try @cache.update() catch | 37 | try @cache.update() catch |
| @@ -77,7 +77,7 @@ class app.views.Document extends app.View · 76 unmodified lines | |||
| 77 | switch target.getAttribute('data-behavior') | 77 | switch target.getAttribute('data-behavior') |
| 78 | when 'back' then history.back() | 78 | when 'back' then history.back() |
| 79 | when 'reload' then window.location.reload() | 79 | when 'reload' then window.location.reload() |
| 80 | when 'reboot' then window.location = '/' | 80 | when 'reboot' then app.reboot() |
| 81 | when 'hard-reload' then app.reload() | 81 | when 'hard-reload' then app.reload() |
| 82 | when 'reset' then app.reset() if confirm('Are you sure you want to reset DevDocs?') | 82 | when 'reset' then app.reset() if confirm('Are you sure you want to reset DevDocs?') |
| 83 | return | 83 | return |