fix No click on drag handler, r=erilem (closes #3210)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11783 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -50,6 +50,13 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
|
||||
*/
|
||||
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 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
|
||||
* {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);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user