Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
SD-894 Add close button in contextual menu
Krzysztof Kalisz45a1730fd37e
diff --git a/backend/app/assets/javascripts/spree/backend/admin.js b/backend/app/assets/javascripts/spree/backend/admin.jsindex 110bfcaa83..30a16d3550 100644--- a/backend/app/assets/javascripts/spree/backend/admin.js+++ b/backend/app/assets/javascripts/spree/backend/admin.js@@ -60,6 +60,7 @@ jQuery(function ($) {// Contextual Sidebar Menuvar contextualSidebarMenuToggle = $('#contextual-menu-toggle')+ var contextualSidebarMenuClose = $('#contextual-menu-close')function toggleContextualMenu() {if (document.body.classList.contains('contextualSideMenu-open')) {@@ -71,6 +72,7 @@ jQuery(function ($) {}}contextualSidebarMenuToggle.click(toggleContextualMenu)+ contextualSidebarMenuClose.click(toggleContextualMenu)// TODO: remove this js temp behaviour and fix this decent// Temp quick searchdiff --git a/backend/app/assets/stylesheets/spree/backend/components/_sidebar.scss b/backend/app/assets/stylesheets/spree/backend/components/_sidebar.scssindex c29392c1ad..06b0d758f3 100644--- a/backend/app/assets/stylesheets/spree/backend/components/_sidebar.scss+++ b/backend/app/assets/stylesheets/spree/backend/components/_sidebar.scss@@ -75,6 +75,9 @@ ul.nav-sidebar {top: -100%;z-index: 1041;transition: .3s ease-in-out;+ .page-actions__close {+ margin: -1.5rem -1.5rem 1.5rem;+ }}#contextual-menu-toggle {diff --git a/backend/app/views/spree/admin/shared/_sidebar.html.erb b/backend/app/views/spree/admin/shared/_sidebar.html.erbindex 0ace5056e5..94250efe19 100644--- a/backend/app/views/spree/admin/shared/_sidebar.html.erb+++ b/backend/app/views/spree/admin/shared/_sidebar.html.erb@@ -1,7 +1,19 @@<% if content_for?(:page_actions) %>- <div class="page-actions d-flex justify-content-center flex-wrap d-lg-none col-12 px-0 <% if content_for?(:sidebar) %>pb-3<% end %> text-center" data-hook="toolbar">- <%= yield :page_actions %>+ <div class="page-actions d-lg-none col-12 px-0 <% if content_for?(:sidebar) %>pb-3<% end %> text-center" data-hook="toolbar">+ <div class="page-actions__close border-bottom text-right">+ <button+ id="contextual-menu-close"+ class="btn btn-link"+ type="button"+ aria-expanded="false"+ aria-label="Toggle page actions">+ <%= svg_icon name: "cancel.svg", width: '20', height: '20' %>+ </button>+ </div>+ <div class="d-flex justify-content-center flex-wrap">+ <%= yield :page_actions %>+ </div></div><% end %>