]> _ Git - fluidbook-html5.git/commitdiff
done #1371 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 26 Apr 2017 17:08:50 +0000 (19:08 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 26 Apr 2017 17:08:50 +0000 (19:08 +0200)
js/libs/fluidbook/fluidbook.touch.js

index 2d34921fd9f6137bc254dea915f1dccdbae04904..a18959b1be645763234cf487a0f079c00ed9880c 100644 (file)
@@ -17,12 +17,8 @@ FluidbookTouch.prototype = {
     init: function () {
         var $this = this;
 
-        $("#main").on('touchend',function(){
-            console.log('touchend from jquery');
-        })
-
         // Pinch to zoom
-        interact(document.getElementById("main")).gesturable({
+        interact(document.getElementById("z")).gesturable({
             onstart: function (event) {
                 if ($this.fluidbook.zoom.zoom == 1) {
                     $this.setZoomOriginFromEvent(event);
@@ -32,18 +28,17 @@ FluidbookTouch.prototype = {
             onmove: function (event) {
                 var ds = event.ds;
                 //if ($this.fluidbook.support.iOS) {
-                    if (ds > 0) {
-                        ds *= 0.25;
-                    } else {
-                        ds *= 0.75;
-                    }
+                if (ds > 0) {
+                    ds *= 0.25;
+                } else {
+                    ds *= 0.75;
+                }
                 //}
                 var s = $this.fluidbook.zoom.zoom * (1 + ds);
                 $this.pinchZoom(s);
                 return false;
             },
             onend: function (event) {
-                console.log('pinch end');
                 return false;
             },
         }).draggable({
@@ -53,13 +48,11 @@ FluidbookTouch.prototype = {
             },
             onend: function (event) {
                 $this.resetSlide();
-                console.log('drag end');
             }
         });
 
         // Double tap
         interact(document).on('doubletap', function (event) {
-
             if ($this.fluidbook.zoom.zoom > 1) {
                 $this.fluidbook.zoom.setTransition(true);
                 $this.fluidbook.zoom.resetZoom();
@@ -82,15 +75,10 @@ FluidbookTouch.prototype = {
         if (e.dx == 0 && e.dy == 0) {
             return;
         }
-
-
         var currentX = (parseFloat(this.fluidbook.zoom.origin[0]) / 100) * this.fluidbook.resize.ww * this.fluidbook.zoom.zoom;
         var currentY = (parseFloat(this.fluidbook.zoom.origin[1]) / 100) * this.fluidbook.resize.hh * this.fluidbook.zoom.zoom;
 
         var m = 2;
-        //if (this.fluidbook.support.android) {
-          //  m = 10;
-        //}
 
         var x = currentX - e.dx * m;
         var y = currentY - e.dy * m;