History

Don't add auto-hide layout based on current location

...instead of just by layout name

Stefan Selent committed 7 years ago

Commit e0e158c1 parent bdb5c402 files · +4 −1Browse files

Unified · Split

2 files
  1. assets/javascripts/app/router.coffee +3 −0
  2. assets/javascripts/app/settings.coffee +1 −1
assets/javascripts/app/router.coffee+3−0
@@ -124,6 +124,9 @@ class app.Router · 123 unmodified lines
124 isIndex: ->124 isIndex: ->
125 @context?.path is '/' or (app.isSingleDoc() and @context?.entry?.isIndex())125 @context?.path is '/' or (app.isSingleDoc() and @context?.entry?.isIndex())
126 126
127 isSettings: ->
128 @context?.path is '/settings'
129
127 setInitialPath: ->130 setInitialPath: ->
128 # Remove superfluous forward slashes at the beginning of the path131 # Remove superfluous forward slashes at the beginning of the path
129 if (path = location.pathname.replace /^\/{2,}/g, '/') isnt location.pathname132 if (path = location.pathname.replace /^\/{2,}/g, '/') isnt location.pathname
assets/javascripts/app/settings.coffee+1−1
@@ -129,7 +129,7 @@ class app.Settings · 128 unmodified lines
129 129
130 toggleLayout: (layout, enable) ->130 toggleLayout: (layout, enable) ->
131 classList = document.body.classList131 classList = document.body.classList
132 classList.toggle(layout, enable) unless layout is '_sidebar-hidden'132 classList.toggle(layout, enable) unless app.router?.isSettings
133 classList.toggle('_overlay-scrollbars', $.overlayScrollbarsEnabled())133 classList.toggle('_overlay-scrollbars', $.overlayScrollbarsEnabled())
134 return134 return
135 135