]> _ Git - fluidbook-html5.git/commitdiff
wait #6533 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 29 Nov 2023 11:24:10 +0000 (12:24 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 29 Nov 2023 11:24:10 +0000 (12:24 +0100)
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/fluidbook.video.js

index 3657bb0fa459e99fa019ec54f122f15942041bf7..1beb8c4479b28f362087bc833fa33c21f2ad4005 100644 (file)
@@ -705,6 +705,12 @@ FluidbookLinks.prototype = {
     initDelayedLink: function (link) {
         $(link).addClass('revealed');
         this.fluidbook.video.initVideos();
+        this.initInlineSlideshows();
+    },
+
+    isDelayed: function (e) {
+        let s = '[data-delay]:not(.revealed)';
+        return $(e).is(s) || $(e).closest(s).length > 0;
     },
 
     replaceVariableInTextLinks: function () {
@@ -1281,7 +1287,9 @@ FluidbookLinks.prototype = {
 
         if (this.fluidbook.slideshow !== undefined) {
             $("#links .fb-slideshow, #currentDoublePage .fb-slideshow").each(function () {
-                $this.fluidbook.slideshow.initInlineSlideshow(this);
+                if (!$this.isDelayed(this)) {
+                    $this.fluidbook.slideshow.initInlineSlideshow(this);
+                }
             });
             this.fluidbook.slideshow.resizeInline();
         }
index 7fbae47183695d3b21da51c70ac60b2b3e57b19e..83c267593f2642f3457588e26f9838707b0a0896 100644 (file)
@@ -241,8 +241,6 @@ FluidbookLoader.prototype = {
         }
 
         var $__callback = function () {
-
-
             if ($this.getVersionToLoad(page) === 'textasvector' || $this.getVersionToLoad(page) === 'vector') {
                 $this.loadTexts(page, $_callback);
             } else {
@@ -353,7 +351,9 @@ FluidbookLoader.prototype = {
                 });
             });
         }
-    }, loadPage: function (pageNr, doublePage, position, callback) {
+    },
+
+    loadPage: function (pageNr, doublePage, position, callback) {
 
         if (pageNr <= 0 || pageNr > this.fluidbook.settings.pages) {
             callback();
index eaf16dd5286cc386225f87b5b05b644a9e850dbf..04224bae4a100736151748471b2c4d42d9bf230d 100644 (file)
@@ -82,7 +82,7 @@ FluidbookVideo.prototype = {
         var $this = this;
 
         $(".videoContainer").each(function () {
-            if ($(this).closest('[data-delay]:not(.revealed)').length > 0) {
+            if ($this.fluidbook.links.isDelayed(this)) {
                 return;
             }
             if ($(this).closest('.rightclone').length > 0 && $(this).is(':hidden')) {