]> _ Git - fluidbook-html5.git/commitdiff
wait #5211 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 5 Apr 2022 08:01:30 +0000 (10:01 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 5 Apr 2022 08:01:30 +0000 (10:01 +0200)
js/libs/fluidbook/fluidbook.touch.js
js/libs/fluidbook/fluidbook.zoom.js

index 6c8fe956087aa87c852ce782b082009ae76ecfe4..5857107136337a1306bee20c7d6b5b74422077cf 100644 (file)
@@ -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;
index 15938e9ab04a789a22c0240556aa1555f9d2cffa..97fff06e8fc9154744d00c160ded68155e191cbc 100644 (file)
@@ -169,7 +169,6 @@ FluidbookZoom.prototype = {
 
 
     setZoom: function (zoom, direction, end) {
-        console.log('set zoom ', zoom);
         var origZoom = this.zoom;
 
         if (end === undefined) {