Cleanup mouse event on touch devices, r=erilem (closes #3215)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11827 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -219,6 +219,7 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
|
||||
this.layer.destroy(false);
|
||||
}
|
||||
this.layer = null;
|
||||
this.touch = false;
|
||||
return true;
|
||||
},
|
||||
|
||||
@@ -385,9 +386,6 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
|
||||
* {Boolean} Allow event propagation
|
||||
*/
|
||||
mousedown: function(evt) {
|
||||
if (this.touch) {
|
||||
return;
|
||||
}
|
||||
return this.down(evt);
|
||||
},
|
||||
|
||||
@@ -402,7 +400,18 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
|
||||
* {Boolean} Allow event propagation
|
||||
*/
|
||||
touchstart: function(evt) {
|
||||
this.touch = true;
|
||||
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,
|
||||
dblclick: this.dblclick,
|
||||
scope: this
|
||||
});
|
||||
}
|
||||
this.lastTouchPx = evt.xy;
|
||||
return this.down(evt);
|
||||
},
|
||||
@@ -418,9 +427,6 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
|
||||
* {Boolean} Allow event propagation
|
||||
*/
|
||||
mousemove: function(evt) {
|
||||
if (this.touch) {
|
||||
return;
|
||||
}
|
||||
return this.move(evt);
|
||||
},
|
||||
|
||||
@@ -450,9 +456,6 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
|
||||
* {Boolean} Allow event propagation
|
||||
*/
|
||||
mouseup: function(evt) {
|
||||
if (this.touch) {
|
||||
return;
|
||||
}
|
||||
return this.up(evt);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user