]> _ Git - fluidbook-html5.git/commitdiff
wait #4508 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 28 Feb 2022 08:24:03 +0000 (09:24 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 28 Feb 2022 08:24:03 +0000 (09:24 +0100)
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.touch.js

index 8ddb88c13bdc2b244985d0c78a5e878ea0ff9731..c1f65e9fc286657a0798b254a0b422395e82006d 100644 (file)
@@ -786,9 +786,18 @@ FluidbookLinks.prototype = {
             }, to.delay * 1000);
         } else if (animation.type === 'draggable') {
             $(link).css('pointer-events', 'auto');
+            var $this = this;
             var draggable = new Draggable(link, {
-                inertia: true, type: 'x', onRelease: function () {
+                inertia: true, type: 'x',
+                onDragStart: function () {
+                    $this.fluidbook.touch.draggingFromOutside = true;
+                },
+                onRelease: function () {
                     var d = this;
+                    setTimeout(function () {
+                        $this.fluidbook.touch.draggingFromOutside = false;
+                    }, 250);
+
                     if (animation.drop === 'clickhide') {
                         $('#links .link a').each(function () {
                             if (d.hitTest(this)) {
@@ -802,6 +811,7 @@ FluidbookLinks.prototype = {
                             }
                         });
                     }
+
                 }
             });
         } else {
index 7c6a38991cf862697e0bd1fb610af1e24201b660..e1646e7574b4f651675d43f70df2cbaf5c333053 100644 (file)
@@ -12,6 +12,8 @@ function FluidbookTouch(fluidbook) {
 
     this.triggerOffset = this.fluidbook.mobilefirst.enabled ? 0.1 : 0.05;
 
+    this.draggingFromOutside = false;
+
     this.init();
 }
 
@@ -257,10 +259,12 @@ FluidbookTouch.prototype = {
             }
 
             var ltr = this.fluidbook.l10n.dir === 'ltr';
-            if ((this.offsetX < 0 && ltr) || (this.offsetX > 0 && !ltr)) {
-                this.fluidbook.goNextPage();
-            } else {
-                this.fluidbook.goPreviousPage();
+            if (!this.draggingFromOutside) {
+                if ((this.offsetX < 0 && ltr) || (this.offsetX > 0 && !ltr)) {
+                    this.fluidbook.goNextPage();
+                } else {
+                    this.fluidbook.goPreviousPage();
+                }
             }
             return true;
         } else {