From: Vincent Vanwaelscappel Date: Tue, 5 Apr 2022 08:01:30 +0000 (+0200) Subject: wait #5211 @0:20 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=28297479c847d23c65bb0c92e8b35e331ab3ea5c;p=fluidbook-html5.git wait #5211 @0:20 --- diff --git a/js/libs/fluidbook/fluidbook.touch.js b/js/libs/fluidbook/fluidbook.touch.js index 6c8fe956..58571071 100644 --- a/js/libs/fluidbook/fluidbook.touch.js +++ b/js/libs/fluidbook/fluidbook.touch.js @@ -82,21 +82,21 @@ FluidbookTouch.prototype = { this.initHammerManager(); if (doubletapEnabled) { - hm.add(new Hammer.Tap({event: 'doubletap', taps: 2, interval: 500})); + this.hm.add(new Hammer.Tap({event: 'doubletap', taps: 2, interval: 500})); } if (tapEnabled) { - hm.add(new Hammer.Tap({event: 'singletap', taps: 1, interval: 500})); + this.hm.add(new Hammer.Tap({event: 'singletap', taps: 1, interval: 500})); } if (pinchEnabled) { - hm.add(new Hammer.Pinch({threshold: 0})); - hm.get('pinch').set({enable: true}); + this.hm.add(new Hammer.Pinch({threshold: 0})); + this.hm.get('pinch').set({enable: true}); } if (doubletapEnabled) { // Double tap - hm.on('doubletap', function (event) { + this.hm.on('doubletap', function (event) { if ($this.fluidbook.zoom.enabled) { if ($this.fluidbook.zoom.zoom > 1) { $this.fluidbook.zoom.setTransition(true); @@ -114,7 +114,7 @@ FluidbookTouch.prototype = { if (pinchEnabled) { // Pinch - hm.on('pinchstart', function (event) { + this.hm.on('pinchstart', function (event) { if ($this.fluidbook.zoom.enabled) { if ($this.fluidbook.zoom.zoom === 1) { $this.setZoomOriginFromEvent({'pageX': event.center.x, 'pageY': event.center.y}); @@ -125,7 +125,7 @@ FluidbookTouch.prototype = { event.preventDefault(); }); - hm.on('pinch', function (event) { + this.hm.on('pinch', function (event) { if ($this.fluidbook.zoom.enabled) { if ($this.zoomAtPinchStart !== 0) { $this.pinchZoom(event.scale, false); @@ -133,7 +133,7 @@ FluidbookTouch.prototype = { } } }); - hm.on('pinchend pinchcancel', function (event) { + this.hm.on('pinchend pinchcancel', function (event) { if ($this.fluidbook.zoom.enabled) { $this.pinchZoom(event.scale, true); $this.zoomAtPinchStart = $this.fluidbook.zoom.zoom; @@ -143,7 +143,7 @@ FluidbookTouch.prototype = { } if (panEnabled) { - this.initPan(panElementId); + this.initPan(this.panElementId); } }, @@ -171,22 +171,22 @@ FluidbookTouch.prototype = { this.initHammerManager(); - var hmf = new Hammer.Manager(document.getElementById(panElementId), this.options); - hmf.add(new Hammer.Pan({threshold: 0})); - hmf.on('pan', function (event) { + this.hmf = new Hammer.Manager(document.getElementById(panElementId), this.options); + this.hmf.add(new Hammer.Pan({threshold: 0})); + this.hmf.on('pan', function (event) { }); - hmf.on('panstart', function (event) { + this.hmf.on('panstart', function (event) { if ($this.drag(event, 'start')) { event.preventDefault(); } }); - hmf.on('panmove', function (event) { + this.hmf.on('panmove', function (event) { if ($this.drag(event, 'move')) { event.preventDefault(); } }); - hmf.on('panend', function (event) { + this.hmf.on('panend', function (event) { var prevent = $this.drag(event, 'end'); $this.startX = $this.startY = -1; $this.panX = $this.panY = 0; diff --git a/js/libs/fluidbook/fluidbook.zoom.js b/js/libs/fluidbook/fluidbook.zoom.js index 15938e9a..97fff06e 100644 --- a/js/libs/fluidbook/fluidbook.zoom.js +++ b/js/libs/fluidbook/fluidbook.zoom.js @@ -169,7 +169,6 @@ FluidbookZoom.prototype = { setZoom: function (zoom, direction, end) { - console.log('set zoom ', zoom); var origZoom = this.zoom; if (end === undefined) {