Making it so controls that register for mousedown and mouseup work in touch environments. r=crschmidt (closes #3075)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11207 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2011-02-21 17:31:19 +00:00
parent 3066b50956
commit 849426f845
3 changed files with 36 additions and 14 deletions

View File

@@ -155,7 +155,10 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
);
this.down(evt);
this.callback("down", [evt.xy]);
OpenLayers.Event.stop(evt);
if (evt.type === "mousedown") {
OpenLayers.Event.stop(evt);
}
if(!this.oldOnselectstart) {
this.oldOnselectstart = document.onselectstart ?
@@ -201,6 +204,9 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
this.interval);
}
this.dragging = true;
if (evt.type === "touchmove") {
OpenLayers.Event.stop(evt);
}
this.move(evt);
this.callback("move", [evt.xy]);
if(!this.oldOnselectstart) {