]> _ Git - fluidbook-html5.git/commitdiff
wait #2643 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 21 Mar 2019 18:19:36 +0000 (19:19 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 21 Mar 2019 18:19:36 +0000 (19:19 +0100)
js/libs/fluidbook/fluidbook.links.js

index 3e0e6b40caed18adc40a12e72fb9039b338e9642..88dd01e403c914a7380c5d57da438e5ced01d2f0 100644 (file)
@@ -220,6 +220,8 @@ FluidbookLinks.prototype = {
     },
 
     initAnimatedContentsLinks: function () {
+        var fluidbook = this.fluidbook;
+        var pauseNetworkDelay = 0;
         $(".contentLink[data-animation]").each(function () {
             var animation = $(this).data('animation');
             if (animation.type === undefined || animation.type === '') {
@@ -355,7 +357,11 @@ FluidbookLinks.prototype = {
                 animation.decimalDigitNumber = parseInt(animation.decimalDigitNumber);
                 animation.letterSpacing = parseFloat(animation.letterSpacing);
 
+                var ea = to.ease.split('.');
+                var ease = window[ea[0]][ea[1]];
+
                 var options = {
+                    duration: duration,
                     useEasing: true,
                     useGrouping: true,
                     separator: animation.separator,
@@ -364,8 +370,7 @@ FluidbookLinks.prototype = {
                     prefix: animation.prefix,
                     suffix: animation.suffix,
                     easingFn: function (t, b, c, d) {
-                        var ea = to.ease.split('.');
-                        return b + window[ea[0]][ea[1]].getRatio(t / d) * c
+                        return b + ease.getRatio(t / d) * c
                     }
                 };
 
@@ -385,12 +390,14 @@ FluidbookLinks.prototype = {
                     countup.start();
                 }, to.delay * 1000);
             }
-
+            pauseNetworkDelay = Math.max(pauseNetworkDelay, to.delay + duration);
             $(this).show();
             if (tweenmax) {
                 TweenMax.fromTo($(this), duration, from, to);
             }
         });
+
+        this.fluidbook.pauseNetwork((pauseNetworkDelay + 1) * 1000)
     },
 
     getLinkDataById: function (uid) {