]> _ Git - fluidbook-html5.git/commitdiff
wip #7489 @10
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 29 Aug 2025 09:52:07 +0000 (11:52 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 29 Aug 2025 09:52:07 +0000 (11:52 +0200)
js/libs/fluidbook/fluidbook.elasticslide.js
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/fluidbook.pagetransitions.js

index 2cea1d0ca74f39d3c54250124801d855c579835e..070f0ef5c83a08c95f387d784802f6034f5a0ca1 100644 (file)
@@ -94,7 +94,7 @@ FluidbookElasticSlide.prototype = {
     },
 
     setCurrentPage: function (page) {
-        if (this.skipChangePage) {
+        if (!this.isActive() || this.skipChangePage ) {
             return;
         }
         let $this = this;
index b711dc6f4bc5ef7091ad4cf32944c85d13b23c2e..271ab250112dfca29b5e524ef957d929a6ae2688 100644 (file)
@@ -521,7 +521,6 @@ Fluidbook.prototype = {
         $(this).trigger('fluidbook.hashchange', [args.slice()]);
 
         if (args[1] === 'closeview') {
-            console.log('closeview');
             return this.setCurrentPage(this.currentPage);
         } else if (args[1] === 'page') {
             var anchor = this.normalizeAnchor(args[2]);
@@ -592,7 +591,7 @@ Fluidbook.prototype = {
                 }
 
                 // Jump to correct page containing this content
-                // TODO: Investigate why this doesn't work properly - it should go to the page containing the link but it seems to get reset to 0, possibly caused by a resize function...
+                console.log('page transition !:!');
                 $this.pagetransitions.pageTransition(this.currentPage);
             }
             this.menu.openView(view, args[2], args[3], function () {
index 8b1db3c59de99d907943987090e656200ae81c0b..0893b9c82b91ef6bb5ee4249cb9f51b57de6e3db 100644 (file)
@@ -236,7 +236,7 @@ FluidbookLoader.prototype = {
         if (this.fluidbook.elasticslide.isActive()) {
             return $("#epage_" + page + ' ' + child);
         } else {
-            return $("page_" + page + ' ' + child);
+            return $("#page_" + page + ' ' + child);
         }
     },
 
@@ -375,7 +375,7 @@ FluidbookLoader.prototype = {
     },
 
     loadPage: function (pageNr, container, position, callback) {
-        if (!$(container).length == 0) {
+        if ($(container).length === 0) {
             container = false;
         }
         if (position !== 'left' && position !== 'right') {
@@ -433,7 +433,6 @@ FluidbookLoader.prototype = {
             $(page).addClass(position);
         }
 
-
         this.renderPDFTextsCanvas();
         this.renderTextsCanvas();
         $(page).show();
@@ -700,14 +699,11 @@ FluidbookLoader.prototype = {
         xhr.responseType = 'blob';
         xhr.onload = function () {
             var fr = new FileReader();
-
             fr.onload = function () {
                 callback(this.result);
             };
-
             fr.readAsDataURL(xhr.response); // async call
         };
-
         xhr.send();
     },
 
index 4b3140ae06ce2ff92db4c5b9e0cb3b65048824df..5df15646f8678c5c608b3193e4481521fe555f40 100644 (file)
@@ -101,7 +101,6 @@ FluidbookPageTransition.prototype = {
         if (transitionType === undefined) {
             transitionType = this.getTransitionType(pageNr);
         }
-
         if (this.fluidbook.firstTransition || transitionType === 'immediate') {
             this.fluidbook.firstTransition = false;
             this.fluidbook.zoom.resetZoom();