From 836b5300fc0379805d0b72cd6f81b717f78fa08a Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Tue, 28 Jun 2022 23:32:06 +0800 Subject: [PATCH] DEV: Move sidebar utility class to body tag (#17259) --- .../discourse/app/controllers/application.js | 5 ---- .../discourse/app/templates/application.hbs | 6 ++-- .../app/templates/components/sidebar.hbs | 24 ++++++++-------- .../tests/acceptance/sidebar-test.js | 28 +++++++++++++------ app/assets/stylesheets/desktop/discourse.scss | 12 ++++---- 5 files changed, 40 insertions(+), 35 deletions(-) diff --git a/app/assets/javascripts/discourse/app/controllers/application.js b/app/assets/javascripts/discourse/app/controllers/application.js index c07ca32adc9..5dcdab3097b 100644 --- a/app/assets/javascripts/discourse/app/controllers/application.js +++ b/app/assets/javascripts/discourse/app/controllers/application.js @@ -8,11 +8,6 @@ export default Controller.extend({ router: service(), showSidebar: true, - @discourseComputed("showSidebar", "currentUser.experimental_sidebar_enabled") - mainOutletWrapperClasses(showSidebar, experimentalSidebarEnabled) { - return showSidebar && experimentalSidebarEnabled ? "has-sidebar" : ""; - }, - @discourseComputed canSignUp() { return ( diff --git a/app/assets/javascripts/discourse/app/templates/application.hbs b/app/assets/javascripts/discourse/app/templates/application.hbs index 7e16b0f9106..1a8cf13f5e0 100644 --- a/app/assets/javascripts/discourse/app/templates/application.hbs +++ b/app/assets/javascripts/discourse/app/templates/application.hbs @@ -15,9 +15,9 @@ {{plugin-outlet name="below-site-header" connectorTagName="div" args=(hash currentPath=router._router.currentPath)}} -
- {{#if currentUser.experimental_sidebar_enabled}} - +
+ {{#if (and currentUser.experimental_sidebar_enabled showSidebar)}} + {{/if}}
diff --git a/app/assets/javascripts/discourse/app/templates/components/sidebar.hbs b/app/assets/javascripts/discourse/app/templates/components/sidebar.hbs index ee690e68081..1f1e8160fa3 100644 --- a/app/assets/javascripts/discourse/app/templates/components/sidebar.hbs +++ b/app/assets/javascripts/discourse/app/templates/components/sidebar.hbs @@ -1,16 +1,14 @@ -{{#if @shouldDisplay}} -