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
124124 isIndex: ->
125125 @context?.path is '/' or (app.isSingleDoc() and @context?.entry?.isIndex())
126126
127+ isSettings: ->
128+ @context?.path is '/settings'
129+
127130 setInitialPath: ->
128131 # Remove superfluous forward slashes at the beginning of the path
129132 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
129129
130130 toggleLayout: (layout, enable) ->
131131 classList = document.body.classList
132− classList.toggle(layout, enable) unless layout is '_sidebar-hidden'
132+ classList.toggle(layout, enable) unless app.router?.isSettings
133133 classList.toggle('_overlay-scrollbars', $.overlayScrollbarsEnabled())
134134 return
135135