Merge pull request #1102 from byted/fix/issue_1101-auto-hide_not_working_after_reload

Fix issue #1101: reloading breaks auto-hide layout
pull/1110/head
Jasper van Merle 5 years ago committed by GitHub
commit f0723ca0e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -124,6 +124,9 @@ class app.Router
isIndex: ->
@context?.path is '/' or (app.isSingleDoc() and @context?.entry?.isIndex())
isSettings: ->
@context?.path is '/settings'
setInitialPath: ->
# Remove superfluous forward slashes at the beginning of the path
if (path = location.pathname.replace /^\/{2,}/g, '/') isnt location.pathname

@ -129,7 +129,7 @@ class app.Settings
toggleLayout: (layout, enable) ->
classList = document.body.classList
classList.toggle(layout, enable) unless layout is '_sidebar-hidden'
classList.toggle(layout, enable) unless app.router?.isSettings
classList.toggle('_overlay-scrollbars', $.overlayScrollbarsEnabled())
return

Loading…
Cancel
Save