]> _ Git - fluidbook-html5.git/commitdiff
wip #7301 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 3 Feb 2025 16:37:21 +0000 (17:37 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 3 Feb 2025 16:37:21 +0000 (17:37 +0100)
js/libs/fluidbook/fluidbook.links.animations.js

index 526c820973cca4c78dcf8296e5a1cbd619e0156c..77df7283ea8fa82d7dcdc028f614026ae3aaf556 100644 (file)
@@ -71,6 +71,7 @@ FluidbookLinksAnimations.prototype = {
         var tweenFunctions = {};
         var duration = 0.5;
         var usegsap = true;
+        var initTransform = $(link).css('transform');
 
         animation = $.extend({}, globalDefault, defaultParams, animation);
 
@@ -94,7 +95,7 @@ FluidbookLinksAnimations.prototype = {
                 css.backgroundSize = '100% 100%';
                 css.backgroundPosition = animation.transformorigin;
             } else {
-                css.transform = 'scale(' + animation.scale + ')';
+                css.transform = initTransform + ' scale(' + animation.scale + ')';
                 css.transformOrigin = animation.transformorigin;
             }
         }
@@ -220,13 +221,13 @@ FluidbookLinksAnimations.prototype = {
             /**
              * Rename animation direction name
              */
-            if(!animation.direction) {
+            if (!animation.direction) {
                 animation.direction = 'right'
             }
-            if(animation.direction === 'top') {
+            if (animation.direction === 'top') {
                 animation.direction = 'up'
             }
-            if(animation.direction === 'bottom') {
+            if (animation.direction === 'bottom') {
                 animation.direction = 'down'
             }
 
@@ -359,7 +360,7 @@ FluidbookLinksAnimations.prototype = {
                 countup.start();
             }, to.delay * 1000);
         } else if (animation.type === 'draggable') {
-            if(this.fluidbook===false){
+            if (this.fluidbook === false) {
                 return;
             }
             this.fluidbook.hasDraggableOnPage(true);