From 0dabd63f3415d8569e758dea03142275c10bebc9 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 11 Mar 2025 15:28:50 +0100 Subject: [PATCH] wip #7380 @3 --- js/libs/fluidbook/fluidbook.resize.js | 20 +++++++++++++++++--- style/help.less | 9 +++++++-- style/slider.less | 5 +++++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.resize.js b/js/libs/fluidbook/fluidbook.resize.js index cf733d6c..db39a424 100644 --- a/js/libs/fluidbook/fluidbook.resize.js +++ b/js/libs/fluidbook/fluidbook.resize.js @@ -33,7 +33,7 @@ function FluidbookResize(fluidbook) { FluidbookResize.prototype = { reduceHorizontalMargins: function () { - return this.fluidbook.mobilefirst.enabled || (this.orientation === 'portrait' && (this.fluidbook.support.iOS || this.fluidbook.support.android)); + return this.fluidbook.mobilefirst.enabled || (this.orientation === 'portrait' && this.fluidbook.nav.burgerActive()); }, reduceVerticalMargins: function () { @@ -46,7 +46,7 @@ FluidbookResize.prototype = { var marginX = 60; if (this.reduceHorizontalMargins()) { - marginX = 20; + marginX = this.fluidbook.settings.mobileHorizontalMargins * 2; } this.marginleft = marginX + parseInt(this.fluidbook.settings.extraXSpace); @@ -57,6 +57,7 @@ FluidbookResize.prototype = { if (this.reduceVerticalMargins()) { this.margintop -= parseInt(this.fluidbook.settings.extraYSpace) this.margintop -= 65; + this.margintop = Math.max(0, this.margintop); this.marginbottom -= 30; } }, @@ -191,7 +192,11 @@ FluidbookResize.prototype = { } this.marginTop = (parseInt(this.fluidbook.settings.menuHeight) * headerScale) + (this.margintop * interfaceScale); - this.marginBottom = (10 + this.marginbottom) * interfaceScale; + if (this.fluidbook.settings.mobileHideSliderIfOverlaps) { + this.marginBottom = 0; + } else { + this.marginBottom = (10 + this.marginbottom) * interfaceScale; + } this.marginLeft = (this.marginleft + parseInt(extraX)) * interfaceScale; this.marginRight = (this.marginright + parseInt(extraX)) * interfaceScale; } @@ -326,6 +331,7 @@ FluidbookResize.prototype = { } this.checkLogoVisibility(); + this.checkSliderVisibility(); $(window).scrollTop(0); var data = { @@ -431,6 +437,14 @@ FluidbookResize.prototype = { } }, + checkSliderVisibility: function () { + if (this.fluidbook.settings.mobileHideSliderIfOverlaps && ($("#slider").get(0).getBoundingClientRect().top - $("#fluidbook").get(0).getBoundingClientRect().bottom < 5)) { + $('body').addClass('slider-hidden'); + } else { + $('body').removeClass('slider-hidden'); + } + }, + checkLogoVisibility: function () { if (this.fluidbook.mobilefirst.enabled || !this.fluidbook.settings.logoHideWhenOverriden) { return; diff --git a/style/help.less b/style/help.less index 317d0077..b550b78b 100644 --- a/style/help.less +++ b/style/help.less @@ -30,13 +30,13 @@ } display: inline-block; - margin:0 7px; + margin: 0 7px; kbd { font-family: @font; border: 1px solid #fff; border-radius: 3px; - padding:1px 3px; + padding: 1px 3px; font-size: 80%; } @@ -223,6 +223,11 @@ } #helpView .interface .slider { + + .slider-hidden & { + display: none !important; + } + position: absolute; display: inline-block; border-left: 1px solid #fff; diff --git a/style/slider.less b/style/slider.less index ffb2bc66..f635a0ad 100644 --- a/style/slider.less +++ b/style/slider.less @@ -25,6 +25,11 @@ } #slider { + .slider-hidden & { + opacity: 0; + touch-action: none; + } + position: absolute; height: 6px; bottom: 20px; -- 2.39.5