[OpenLayers-Commits] r11783 - trunk/openlayers/lib/OpenLayers/Handler

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Mar 30 09:38:17 EDT 2011


Author: sbrunner
Date: 2011-03-30 06:38:17 -0700 (Wed, 30 Mar 2011)
New Revision: 11783

Modified:
   trunk/openlayers/lib/OpenLayers/Handler/Drag.js
Log:
fix No click on drag handler, r=erilem (closes #3210)

Modified: trunk/openlayers/lib/OpenLayers/Handler/Drag.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Handler/Drag.js	2011-03-30 13:36:49 UTC (rev 11782)
+++ trunk/openlayers/lib/OpenLayers/Handler/Drag.js	2011-03-30 13:38:17 UTC (rev 11783)
@@ -50,6 +50,13 @@
      */
     dragging: false,
 
+    /**
+     * Property: touch
+     * {Boolean} When a touchstart event is fired, touch will be true and all
+     *     mouse related listeners will do nothing.
+     */
+    touch: false,
+
     /** 
      * Property: last
      * {<OpenLayers.Pixel>} The last pixel location of the drag.
@@ -336,6 +343,17 @@
      * {Boolean} Let the event propagate.
      */
     touchstart: function(evt) {
+        if (!this.touch) {
+            this.touch = true;
+            // unregister mouse listeners
+            this.map.events.un({
+                mousedown: this.mousedown,
+                mouseup: this.mouseup,
+                mousemove: this.mousemove,
+                click: this.click,
+                scope: this
+            });
+        }
         return this.dragstart(evt);
     },
 



More information about the Commits mailing list