]> _ Git - fluidbook-html5.git/commitdiff
wait #6004 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Jun 2023 14:21:52 +0000 (16:21 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Jun 2023 14:21:52 +0000 (16:21 +0200)
js/libs/fluidbook/fluidbook.help.js
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.nav.js
js/libs/fluidbook/fluidbook.resize.js
style/fluidbook.less
style/nav-horizontal.less

index 420f3e8b19eea8b10e1d5936f8e8ff1b0c574f7e..2f1e7975b86271cf4b941e6a441abd302643295c 100644 (file)
@@ -110,7 +110,7 @@ FluidbookHelp.prototype = {
 
         // When the menu position is inverted, the icon help lines need
         // to be drawn in the reverse order to avoid text/line overlaps
-        var tooltips = this.fluidbook._boolean(this.fluidbook.settings.invertMenuPosition) ? $(tooltipSelector).get().reverse() : $(tooltipSelector);
+        var tooltips = this.fluidbook.nav.isInverted() ? $(tooltipSelector).get().reverse() : $(tooltipSelector);
         var navScale = this.fluidbook.resize.navScale;
         var initialHeight = 20 * navScale; // Buffer in line height away from icons
         var hStep = 25 * navScale; // The step height - the difference in height between the icon label lines
@@ -335,7 +335,7 @@ FluidbookHelp.prototype = {
         }
 
         if (this.fluidbook.bookmarks.enabled) {
-            var inverted = this.fluidbook._boolean(this.fluidbook.settings.invertMenuPosition);
+            var inverted = this.fluidbook.nav.isInverted() ;
             var side = ((this.fluidbook.l10n.dir === 'ltr' && inverted) || (this.fluidbook.l10n.dir === 'rtl' && !inverted)) ? 'left' : 'right';
             if (this.fluidbook.mobilefirst.enabled) {
                 side = 'right';
@@ -469,7 +469,7 @@ FluidbookHelp.prototype = {
             return true;
         }
 
-        if (!this.fluidbook._boolean(this.fluidbook.settings.invertMenuPosition) && !this.fluidbook.getButtonsVisibility().next && this.fluidbook.contentlock.getMaxPage() % 2 === 0) {
+        if (!this.fluidbook.nav.isInverted()  && !this.fluidbook.getButtonsVisibility().next && this.fluidbook.contentlock.getMaxPage() % 2 === 0) {
             return false;
         }
 
index 8905f4100d108aebe65fdcf6831dde5835c93275..f170c07cb73216a3c75f1d247a023d9e399f170a 100644 (file)
@@ -226,12 +226,16 @@ Fluidbook.prototype = {
             $('html').addClass('sharp');
         }
 
-        if (this._boolean(this.settings.invertMenuPosition)) {
+        if (this.nav.isInverted() ) {
             $('html').addClass('menu-inverted');
         } else {
             $('html').addClass('menu-default');
         }
 
+        if(this.nav.isLogoCentered()){
+            $('#logo').addClass('center');
+        }
+
         $(document).on('fluidbook.init', function () {
             var logoImg = $("#splash .logo img");
             if ($(logoImg).isLoaded()) {
index b17d259e8a315f5546f20245b00184297b0a9a34..5bc67bb78d9aaf5e28aca4097d4be9ae64d05b39 100644 (file)
@@ -9,7 +9,7 @@ function FluidbookNav(fluidbook) {
     this.horizontalNav = $("#horizontalNav");
     this._inited = {};
     this.setNav('horizontalNav');
-    if($("#iconList").html()!=='') {
+    if ($("#iconList").html() !== '') {
         this.setNav('menu');
     }
     if (Modernizr.msie) {
@@ -23,9 +23,23 @@ function FluidbookNav(fluidbook) {
 }
 
 FluidbookNav.prototype = {
+    isLogoCentered: function () {
+        return this.fluidbook.settings.invertMenuPosition >= 2;
+    },
+
+    isInverted: function () {
+        let v = this.fluidbook.settings.invertMenuPosition;
+        if (v === false || v === 'false' || v == 0 || v == 2) {
+            return false;
+        } else if (v === true || v === 'true' || v == 1 || v == 3) {
+            return true;
+        }
+        return false;
+    },
+
     initMenu: function () {
         var $this = this, dir = this.fluidbook.l10n.dir,
-            inverted = this.fluidbook._boolean(this.fluidbook.settings.invertMenuPosition),
+            inverted = this.isInverted(),
             side = ((dir === 'ltr' && inverted) || (dir === 'rtl' && !inverted)) ? 'right' : 'left';
 
         var extensions = ['pagedim-black', 'position-front'];
index c06853133aa9ad6fce5709578d1be49ccc7525dc..55bf9ffa776e06f54f7cd63d371ae6ad6e8518a2 100644 (file)
@@ -238,13 +238,8 @@ FluidbookResize.prototype = {
             transform: 'scale(' + (this.bookScale) + ')', top: this.fh, fontSize: 11.25 / this.bookScale
         });
 
-        if (this.fluidbook._boolean(this.fluidbook.settings.logoHideWhenOverriden)) {
-            var availableWidthForLogo = (this.ww - this.fw) / 2;
-            if ($("#logo").outerWidth() > availableWidthForLogo) {
-                $("#logo").addClass('overridenByFluidbook');
-            } else {
-                $("#logo").removeClass('overridenByFluidbook');
-            }
+        if (this.fluidbook.nav.isLogoCentered()) {
+            $("#logo").css('left', (this.ww - this.fluidbook.settings.logoDimensions[0]) / 2);
         }
 
         if (this.fluidbook.interface.arrowsEnabled()) {
@@ -423,7 +418,7 @@ FluidbookResize.prototype = {
 
     resizeAfterSearch: function () {
         var rect = $("#horizontalNav").get(0).getBoundingClientRect();
-        var inverted = this.fluidbook._boolean(this.fluidbook.settings.invertMenuPosition)
+        var inverted = this.fluidbook.nav.isInverted()
         if ((this.fluidbook.l10n.ltr && !inverted) || (this.fluidbook.l10n.rtl && inverted)) {
             $("#afterSearch").css({left: rect.left + rect.width, right: 'auto'});
         } else {
@@ -432,12 +427,12 @@ FluidbookResize.prototype = {
     },
 
     checkLogoVisibility: function () {
-        if (this.fluidbook.mobilefirst.enabled) {
+        if (this.fluidbook.mobilefirst.enabled || !this.fluidbook.settings.logoHideWhenOverriden) {
             return;
         }
         var logo = document.getElementById("logo").getBoundingClientRect();
         var fluidbook = document.getElementById("fluidbook").getBoundingClientRect();
-        var inverted = this.fluidbook._boolean(this.fluidbook.settings.invertMenuPosition);
+        var inverted = this.fluidbook.nav.isInverted();
 
         var overlapY = logo.bottom > fluidbook.top;
         var overlapX;
index 801d21d43c97080fd9efda315a7d9d4085512eab..b3d4f9742dd6e5bcd2cd6eca42e23b681e8d0047 100644 (file)
@@ -1000,6 +1000,10 @@ input[type="search"]::-webkit-search-results-decoration {
     visibility: hidden;
   }
 
+  &.center {
+    right: auto !important;
+  }
+
   // Positioning for left-to-right Fluidbooks + inverted menu on RTL
   .ltr &, .rtl.menu-inverted & {
     right: 0;
@@ -1716,8 +1720,9 @@ html.ios body.portrait #interface {
     }
   }
 
-  &[data-menu="audio"]{
+  &[data-menu="audio"] {
     overflow: visible;
+
     a, div {
       &.button.back {
         top: -30px;
index aeaa25e89c46a46c5f9c1bd27b501cd871ed2db6..4e63696f9d211a50891340a9229365c3ceed7a44 100644 (file)
   li {
     display: inline-block;
     vertical-align: middle;
+
+    &:first-child {
+      a.icon-locales {
+        border: 0;
+      }
+    }
   }
 
   a {
     }
   }
 
-  span{
+  span {
     transition: color @page-transition-duration;
   }