[OpenLayers-Commits] r11439 - in sandbox/pinch/lib/OpenLayers: Control Handler

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Thu Feb 24 12:11:44 EST 2011


Author: tschaub
Date: 2011-02-24 09:11:44 -0800 (Thu, 24 Feb 2011)
New Revision: 11439

Modified:
   sandbox/pinch/lib/OpenLayers/Control/TouchNavigation.js
   sandbox/pinch/lib/OpenLayers/Handler/Pinch.js
Log:
Switch order of handler activation and stop propagation so we don't get a zoom out after pinch without drag.

Modified: sandbox/pinch/lib/OpenLayers/Control/TouchNavigation.js
===================================================================
--- sandbox/pinch/lib/OpenLayers/Control/TouchNavigation.js	2011-02-24 17:06:34 UTC (rev 11438)
+++ sandbox/pinch/lib/OpenLayers/Control/TouchNavigation.js	2011-02-24 17:11:44 UTC (rev 11439)
@@ -96,8 +96,8 @@
     activate: function() {
         if(OpenLayers.Control.prototype.activate.apply(this,arguments)) {
             this.dragPan.activate();
+            this.handlers.click.activate();
             this.pinchZoom.activate();
-            this.handlers.click.activate();
             return true;
         }
         return false;
@@ -109,8 +109,8 @@
     deactivate: function() {
         if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)) {
             this.dragPan.deactivate();
+            this.handlers.click.deactivate();
             this.pinchZoom.deactivate();
-            this.handlers.click.deactivate();
             return true;
         }
         return false;

Modified: sandbox/pinch/lib/OpenLayers/Handler/Pinch.js
===================================================================
--- sandbox/pinch/lib/OpenLayers/Handler/Pinch.js	2011-02-24 17:06:34 UTC (rev 11438)
+++ sandbox/pinch/lib/OpenLayers/Handler/Pinch.js	2011-02-24 17:11:44 UTC (rev 11439)
@@ -142,14 +142,16 @@
      * {Boolean} Let the event propagate.
      */
     touchend: function(evt) {
+        var propagate = true;
         if (this.started) {
             this.started = false;
             this.pinching = false;
             this.callback("done", [evt, this.start, this.last]);
             this.start = null;
             this.last = null;
+            propagate = false;
         }
-        return true;
+        return propagate;
     },
 
     /**



More information about the Commits mailing list