]> _ Git - fluidbook-html5.git/commitdiff
wait #2653 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 28 Mar 2019 11:36:13 +0000 (12:36 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 28 Mar 2019 11:36:13 +0000 (12:36 +0100)
js/libs/fluidbook/fluidbook.input.js
js/libs/fluidbook/fluidbook.touch.js

index b12bb2aedaad05fcf415a88ccd2dbf1aaec86b87..b5413f8c2dc4fce8aa6cc96a3d40338c6b3ad2fe 100644 (file)
@@ -21,7 +21,7 @@ FluidbookInput.prototype = {
             return;
         }
 
-        if (Modernizr.iOS || Modernizr.android) {
+        if (Modernizr.ios || Modernizr.android) {
             this.usingTouch = this.hasTouch = this.forceTouch = true;
             this.usingMouse = this.hasMouse = this.forceMouse = false;
             this.setTouchClasses();
index b5e46429ee6f0f92214e95fb510d416b07f6017a..cc867e5f35e9d82336281aee655fc82f535adda3 100644 (file)
@@ -47,6 +47,7 @@ FluidbookTouch.prototype = {
 
         // Double tap
         hm.on('doubletap', function (event) {
+            console.log('doubletap');
             if ($this.fluidbook.zoom.zoom > 1) {
                 $this.fluidbook.zoom.setTransition(true);
                 $this.fluidbook.zoom.resetZoom();
@@ -60,6 +61,7 @@ FluidbookTouch.prototype = {
         // Pinch
 
         hm.on('pinchstart', function (event) {
+            console.log('pinchstart');
             if ($this.fluidbook.zoom.zoom == 1) {
                 $this.setZoomOriginFromEvent({'pageX': event.center.x, 'pageY': event.center.y});
             }
@@ -69,12 +71,14 @@ FluidbookTouch.prototype = {
         });
 
         hm.on('pinch', function (event) {
+            console.log('pinch');
             if ($this.zoomAtPinchStart != 0) {
                 $this.pinchZoom(event.scale, false);
                 event.preventDefault();
             }
         });
         hm.on('pinchend pinchcancel', function (event) {
+            console.log('pinchend');
             $this.pinchZoom(event.scale, true);
             $this.zoomAtPinchStart = $this.fluidbook.zoom.zoom;
             event.preventDefault();
@@ -83,10 +87,12 @@ FluidbookTouch.prototype = {
         var hmf = new Hammer.Manager(document.getElementById('fluidbook'), {domEvents: false});
         hmf.add(new Hammer.Pan({threshold: 0}));
         hmf.on('panmove', function (event) {
+            console.log('panmove');
             $this.drag(event);
             event.preventDefault();
         });
         hmf.on('panend', function (event) {
+            console.log('panend');
             $this.drag(event, true);
             $this.startX = $this.startY = -1;
             $this.panX = $this.panY = 0;
@@ -95,7 +101,6 @@ FluidbookTouch.prototype = {
     },
 
     pinchZoom: function (s, end) {
-
         if (s == 1) {
             return;
         }