From 986503ad9c8aee1d5833d7f29426795d2665384b Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 23 Oct 2023 16:33:36 +0200 Subject: [PATCH] wait #6432 @1.25 --- js/libs/fluidbook/fluidbook.links.js | 32 ++++++---------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.links.js b/js/libs/fluidbook/fluidbook.links.js index 93785705..7e562b18 100644 --- a/js/libs/fluidbook/fluidbook.links.js +++ b/js/libs/fluidbook/fluidbook.links.js @@ -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) { -- 2.39.5