]> _ Git - fluidbook-html5.git/commitdiff
wip #7380 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 11 Mar 2025 14:28:50 +0000 (15:28 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 11 Mar 2025 14:28:50 +0000 (15:28 +0100)
js/libs/fluidbook/fluidbook.resize.js
style/help.less
style/slider.less

index cf733d6cd226b3f427926c8cd37df6b0119fec6d..db39a42455641d585d5b598f5797cc7446a506dc 100644 (file)
@@ -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;
index 317d0077ceb61181b3a95cde595fb61927ada36f..b550b78b8e95c27983bd755fa7a3c64e8f10652c 100644 (file)
     }
 
     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%;
     }
 
 }
 
 #helpView .interface .slider {
+
+  .slider-hidden & {
+    display: none !important;
+  }
+
   position: absolute;
   display: inline-block;
   border-left: 1px solid #fff;
index ffb2bc6683b738e97d99c4803efb3f8bc14272db..f635a0adae099eb6ab866d6e8be6f72dd9948dcf 100644 (file)
 }
 
 #slider {
+  .slider-hidden & {
+    opacity: 0;
+    touch-action: none;
+  }
+
   position: absolute;
   height: 6px;
   bottom: 20px;