]> _ Git - fluidbook-html5.git/commitdiff
wait #6432 @1.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 23 Oct 2023 14:33:36 +0000 (16:33 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 23 Oct 2023 14:33:36 +0000 (16:33 +0200)
js/libs/fluidbook/fluidbook.links.js

index 937857050b6213bdf8e7314cbfe0d3f1c7afda34..7e562b184a324b181ca8ec4911eb3ef99e25a9b4 100644 (file)
@@ -766,10 +766,9 @@ FluidbookLinks.prototype = {
             animations[0]['autostart'] = false;
         }
 
-        var autoStartThisAnim = true;
 
         if (autostart && !animations[0]['autostart']) {
-            autoStartThisAnim = false;
+            return;
         }
 
         $.each(defaults, function (k, v) {
@@ -784,21 +783,12 @@ FluidbookLinks.prototype = {
         }
 
         $.each(animations, function (k, animation) {
-            $this.executeAnimation(link, $.extend({}, firstDefaults, animation, override), autoStartThisAnim);
+            $this.executeAnimation(link, $.extend({}, firstDefaults, animation, override));
         });
     },
 
-    executeAnimation: function (link, animation, autoStart) {
-        if (autoStart === undefined) {
-            autoStart = true;
-        }
-        if (autoStart) {
-            $(link).data('animation-started', true);
-            if ($(link).data('gsap') !== undefined && $(link).data('gsap') !== null) {
-                $(link).data('gsap').play();
-                return;
-            }
-        }
+    executeAnimation: function (link, animation) {
+        $(link).data('animation-started', true);
 
         link = $(link);
         var linkElement = $(link).get(0);
@@ -1112,18 +1102,10 @@ FluidbookLinks.prototype = {
         }
         if (usegsap) {
             to.duration = duration;
-            var a = gsap.fromTo(animatedElement, from, to);
-            if (!autoStart) {
-                a.play()
-                setTimeout(function () {
-                    a.pause().seek(0);
-                }, 10);
-                $(link).data('gsap', a);
-            }
-        }
-        if (autoStart) {
-            this.fluidbook.networkControl.pause((to.delay + duration + 0.5) * 1000);
+            gsap.fromTo(animatedElement, from, to);
         }
+
+        this.fluidbook.networkControl.pause((to.delay + duration + 0.5) * 1000);
     },
 
     fixEase: function (ease) {