From 65a017d0d92ac8856e90bc5f8939692c97326d0b Mon Sep 17 00:00:00 2001 From: Michela Frecchiami Date: Fri, 13 Sep 2019 18:15:56 +0200 Subject: [PATCH] Fix chevron left/right on sidebar collapsed Avoid wrong chevron position when the sidebar is collapsed and the user reload the page. Avoid clickable overflow on nav toggle button. --- .../javascripts/spree/backend/components/admin_nav.js | 4 ++++ .../stylesheets/spree/backend/components/_navigation.scss | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/backend/app/assets/javascripts/spree/backend/components/admin_nav.js b/backend/app/assets/javascripts/spree/backend/components/admin_nav.js index 8dd2e35e1a3..a22bf68f998 100644 --- a/backend/app/assets/javascripts/spree/backend/components/admin_nav.js +++ b/backend/app/assets/javascripts/spree/backend/components/admin_nav.js @@ -19,6 +19,10 @@ Spree.ready(function() { }); } + if (document.body.classList.contains('admin-nav-hidden')) { + $(adminNavToggle).removeClass('fa-chevron-circle-left').addClass('fa-chevron-circle-right'); + } + function toggleTooltips() { $(".tab-with-icon .text:visible").each(function() { $(this.closest(".tab-with-icon")).attr("data-original-title", "").tooltip(); diff --git a/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss b/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss index 28e6461b6be..3520a57b554 100644 --- a/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss +++ b/backend/app/assets/stylesheets/spree/backend/components/_navigation.scss @@ -10,6 +10,7 @@ $padding-y-navbar-submenu: 9px; color: $color-navbar; font-weight: $font-weight-bold; position: relative; + overflow: hidden; display: block; height: 39px; z-index: 1; @@ -58,7 +59,7 @@ $padding-y-navbar-submenu: 9px; } .admin-login-nav a { - text-overflow:clip; + text-overflow: clip; } .brand-link { @@ -258,7 +259,7 @@ nav.menu { &:before { z-index: 1; top: 1.5em; - pointer-events:none; + pointer-events: none; } &:after { @@ -272,7 +273,7 @@ nav.menu { left: -2.1em; top: 1.5em; margin-top: -1em; - pointer-events:none; + pointer-events: none; } > li {