From ebe9784b23d6633cf690776ebbf936aabff32895 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 29 Jun 2023 09:59:36 +0300 Subject: [PATCH] stick bar fixes --- client/src/views/record/detail.js | 4 +++- client/src/views/record/list.js | 9 ++++++++- frontend/less/espo/custom.less | 6 +++--- frontend/less/espo/elements/modal.less | 1 - frontend/less/espo/variables.less | 6 ++++++ 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/client/src/views/record/detail.js b/client/src/views/record/detail.js index 16b0fb732a..570c4af3ae 100644 --- a/client/src/views/record/detail.js +++ b/client/src/views/record/detail.js @@ -1359,7 +1359,7 @@ class DetailRecordView extends BaseRecordView { let getOffsetTop = (/** JQuery */$element) => { let element = $element.get(0); - let value = -3; + let value = 0; while (element) { value += !isNaN(element.offsetTop) ? element.offsetTop : 0; @@ -1377,6 +1377,8 @@ class DetailRecordView extends BaseRecordView { let stickTop = getOffsetTop($container); let blockHeight = $container.outerHeight(); + stickTop -= 5; // padding; + let $block = $('
') .css('height', blockHeight + 'px') .html(' ') diff --git a/client/src/views/record/list.js b/client/src/views/record/list.js index 99e88b6dd8..ebadd96140 100644 --- a/client/src/views/record/list.js +++ b/client/src/views/record/list.js @@ -766,7 +766,7 @@ class ListRecordView extends View { let isSmallWindow = $(window.document).width() < screenWidthXs; let getOffsetTop = (element) => { - let offsetTop = isModal ? 0 : -3; + let offsetTop = 0; let withHeader = !isSmallWindow && !isModal; @@ -797,6 +797,13 @@ class ListRecordView extends View { let middleTop = getOffsetTop($middle.get(0)); let buttonsTop = getOffsetTop(this.$el.find('.list-buttons-container').get(0)); + if (!isModal) { + // padding + middleTop -= 5; + buttonsTop -= 5; + } + + $scrollable.off('scroll.list-' + this.cid); $scrollable.on('scroll.list-' + this.cid, () => controlSticking()); diff --git a/frontend/less/espo/custom.less b/frontend/less/espo/custom.less index 0ce9d5e14b..9a474b67d3 100644 --- a/frontend/less/espo/custom.less +++ b/frontend/less/espo/custom.less @@ -878,8 +878,8 @@ input.global-search-input { position: fixed; background-color: var(--navbar-bg); z-index: 1000; - padding-top: 3px; - padding-bottom: @padding-large-vertical; + padding-top: @padding-small-vertical; + padding-bottom: @padding-small-vertical; } .list-buttons-container > .actions { @@ -2081,7 +2081,7 @@ label.attach-file-label { .stick-sub.button-container { background-color: var(--navbar-bg); - padding: 3px @container-padding @padding-large-vertical @container-padding; + padding: @padding-small-vertical @container-padding @padding-small-vertical @container-padding; width: 100%; } diff --git a/frontend/less/espo/elements/modal.less b/frontend/less/espo/elements/modal.less index 1caece142b..81b7db08b0 100644 --- a/frontend/less/espo/elements/modal.less +++ b/frontend/less/espo/elements/modal.less @@ -178,7 +178,6 @@ width: 100% !important; right: 0 !important; left: unset !important; - padding-top: 0; padding-left: @container-padding - 1px; } diff --git a/frontend/less/espo/variables.less b/frontend/less/espo/variables.less index a5974a15ba..a80b72f837 100644 --- a/frontend/less/espo/variables.less +++ b/frontend/less/espo/variables.less @@ -121,8 +121,14 @@ @modal-title-padding: 10px; @modal-backdrop-bg: var(--modal-backdrop-bg); +@padding-base-vertical: 6px; @padding-base-horizontal: 10px; + @padding-large-vertical: 10px; +@padding-large-horizontal: 16px; + +@padding-small-vertical: 5px; +@padding-small-horizontal: 10px; @navbar-height: 39px; @navbar-padding-vertical: ((@navbar-height - @line-height-computed) / 2);