From ebae69d00cb29a7e3dc028d3fc09eb141542dd7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20=C3=96hman?= Date: Sun, 11 Feb 2018 16:58:46 +0100 Subject: [PATCH] U4-10962 - Disable stickyheader when nested, fix margins when disabled --- .../components/umbstickybar.directive.js | 5 +++++ .../subheader/umb-editor-sub-header.less | 22 ++++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbstickybar.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbstickybar.directive.js index 91a0a41a10..e8d8315b7a 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/umbstickybar.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/umbstickybar.directive.js @@ -50,6 +50,11 @@ Use this directive make an element sticky and follow the page when scrolling. function activate() { + if (bar.parents(".umb-property").length > 1) { + bar.addClass("nested"); + return; + } + if (attr.scrollableContainer) { scrollableContainer = $(attr.scrollableContainer); } else { diff --git a/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less b/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less index b94055a0d2..fb71016f90 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less @@ -1,12 +1,18 @@ .umb-editor-sub-header { - padding: 15px 0; - margin-bottom: 30px; - background: @white; - display: flex; - justify-content: space-between; - margin-top: -30px; - position: relative; - top: 0; + padding: 15px 0; + margin-bottom: 30px; + background: @white; + display: flex; + justify-content: space-between; + margin-top: -30px; + position: relative; + top: 0; + + &.nested { + margin-top: 0; + margin-bottom: 0; + background: @gray-10; + } } .umb-editor-sub-header.-umb-sticky-bar {