From: Vincent Vanwaelscappel Date: Wed, 26 Apr 2017 17:08:50 +0000 (+0200) Subject: done #1371 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1fa254d4294ae2540bbb0713e7c6a487659e02e0;p=fluidbook-html5.git done #1371 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.touch.js b/js/libs/fluidbook/fluidbook.touch.js index 2d34921f..a18959b1 100644 --- a/js/libs/fluidbook/fluidbook.touch.js +++ b/js/libs/fluidbook/fluidbook.touch.js @@ -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;