]> _ Git - fluidbook-html5.git/commitdiff
wip #3997 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 27 Oct 2020 16:44:12 +0000 (17:44 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 27 Oct 2020 16:44:12 +0000 (17:44 +0100)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.notes.js
js/libs/fluidbook/fluidbook.resize.js
js/libs/fluidbook/fluidbook.tabs.js

index 1a1905678195d51d0c67c7f77278868fb6f3c0d3..21079dfe6d10850f36223e96615bb3e95d0b9a4b 100644 (file)
@@ -59,6 +59,7 @@ Fluidbook.prototype = {
         if (!this.mobilefirst.enabled) {
             this.slider = new FluidbookSlider(this);
         }
+        this.displayOnePage = this.alwaysDisplayOnePage = this.settings.mobileNavigationType === 'portrait' || (this.pad && this.pad.enabled) || this.mobilefirst.enabled;
         this.zoom = new FluidbookZoom(this);
         this.zoom.resetZoom();
         this.cache = new FluidbookCache(this.settings);
@@ -109,7 +110,6 @@ Fluidbook.prototype = {
         this.refh = 0;
         this.searchString = '';
         this.vectorTexts = !this.support.imagesVersion;
-        this.displayOnePage = false;
         this.indexHTML = '';
         this.gal = null;
         this.isReady = false;
index 359988ad5e9de6bde5e4b0d493c059eb287d35d1..249e6d70686f98b10df1f8096db352b7dba4a793 100644 (file)
@@ -53,6 +53,7 @@ FluidbookNotes.prototype = {
             this.toggleNotes();
         }
     },
+
     toggleNotes: function () {
         $('body').toggleClass('notes-hidden').toggleClass('notes-unhidden');
     },
@@ -162,9 +163,7 @@ FluidbookNotes.prototype = {
         var $this = this;
         $.each(this.getAllNotes(), function (k, note) {
             if (!$this.fluidbook.displayOnePage) {
-                if (note.p === 0) {
-                    note.p = 1;
-                } else if (note.p % 2 === 1) {
+                if (note.p % 2 === 1) {
                     note.p--;
                 }
             }
index 4dcb69ce04d27b9aef894fefe9ec271347aeb435..2669a1e5f8ce6f9310dca4b5b5d2c0bfd15d6b60 100644 (file)
@@ -438,7 +438,7 @@ FluidbookResize.prototype = {
         this.orientation = newo;
 
         $('body').addClass(this.orientation);
-        this.fluidbook.displayOnePage = (this.orientation === 'portrait');
+        this.fluidbook.displayOnePage = this.fluidbook.alwaysDisplayOnePage || (this.orientation === 'portrait');
 
         if (changeOrientation) {
             $(this.fluidbook).trigger('fluidbook.resize.beforeOrientationChange');
index 7b8cf6ea1f0103846a1ac39841761e7865fb3454..2918884c0f2a5464158c31ddfcbc29b20cb64027 100644 (file)
@@ -138,8 +138,7 @@ FluidbookTabs.prototype = {
             var i = 0;
             $.each(sectionPages, function (k, value) {
                 if (value !== '-') {
-                    console.log(value);
-                    if (value % 2 === 1) {
+                    if (!$this.fluidbook.alwaysDisplayOnePage && value % 2 === 1) {
                         value--;
                     }
                     $this.links.push({
@@ -190,9 +189,6 @@ FluidbookTabs.prototype = {
             }
         });
 
-        console.log(page, id, this.links);
-
-
         if (id === 'none') {
             this.svg.find('[id^="o"].active').removeClass('active');
         } else {