]> _ Git - fluidbook-html5.git/commitdiff
wip #4508 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 11 Mar 2022 11:02:45 +0000 (12:02 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 11 Mar 2022 11:02:45 +0000 (12:02 +0100)
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.touch.js

index 6b5b235ae48206e7f4dc337edd3b66af64786834..54a6c1c085d329a9160e1169aead8b23cc66f1f8 100644 (file)
@@ -785,6 +785,7 @@ FluidbookLinks.prototype = {
                 countup.start();
             }, to.delay * 1000);
         } else if (animation.type === 'draggable') {
+            this.fluidbook.touch.hasDraggableOnPage = true;
             $(link).css('pointer-events', 'auto');
             var $this = this;
             var draggable = new Draggable(link, {
index e1646e7574b4f651675d43f70df2cbaf5c333053..4cdd3120b6bfeddecc2511b6ecdc483e916fef31 100644 (file)
@@ -13,6 +13,7 @@ function FluidbookTouch(fluidbook) {
     this.triggerOffset = this.fluidbook.mobilefirst.enabled ? 0.1 : 0.05;
 
     this.draggingFromOutside = false;
+    this.hasDraggableOnPage = false;
 
     this.init();
 }
@@ -31,6 +32,9 @@ FluidbookTouch.prototype = {
         //     }, false);
         // }
 
+        $(this.fluidbook).on('fluidbook.page.change.start', function () {
+            $this.draggingFromOutside = $this.hasDraggableOnPage = false;
+        });
 
         $(this.fluidbook).on('fluidbook.page.change.end', function () {
             $this.resetSlide();
@@ -61,8 +65,7 @@ FluidbookTouch.prototype = {
         }
 
         var options = {
-            domEvents: this.fluidbook.mobilefirst.enabled,
-            touchAction: touchAction
+            domEvents: this.fluidbook.mobilefirst.enabled, touchAction: touchAction
         };
         Hammer.defaults.domEvents = options.domEvents;
         Hammer.defaults.touchAction = options.touchAction;
@@ -259,7 +262,7 @@ FluidbookTouch.prototype = {
             }
 
             var ltr = this.fluidbook.l10n.dir === 'ltr';
-            if (!this.draggingFromOutside) {
+            if (!this.draggingFromOutside && !this.hasDraggableOnPage) {
                 if ((this.offsetX < 0 && ltr) || (this.offsetX > 0 && !ltr)) {
                     this.fluidbook.goNextPage();
                 } else {
@@ -307,8 +310,7 @@ FluidbookTouch.prototype = {
         this.startY = -1;
         this.offsetX = 0;
         this.offsetY = 0;
-    },
-    setZoomOriginFromEvent: function (event) {
+    }, setZoomOriginFromEvent: function (event) {
         var cx = event.pageX;
         var cy = event.pageY;