From e0e158c8d707eb59d141bc484ef5657416e8ac0d Mon Sep 17 00:00:00 2001 From: Stefan Selent Date: Mon, 7 Oct 2019 20:56:53 -0700 Subject: [PATCH] Don't add auto-hide layout based on current location ...instead of just by layout name --- assets/javascripts/app/router.coffee | 3 +++ assets/javascripts/app/settings.coffee | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/javascripts/app/router.coffee b/assets/javascripts/app/router.coffee index 38617f12..ba25148a 100644 --- a/assets/javascripts/app/router.coffee +++ b/assets/javascripts/app/router.coffee @@ -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 diff --git a/assets/javascripts/app/settings.coffee b/assets/javascripts/app/settings.coffee index 350a08c0..8a4c2b72 100644 --- a/assets/javascripts/app/settings.coffee +++ b/assets/javascripts/app/settings.coffee @@ -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