Merge pull request #224 from jorix/3402-touch_logic_to_superclass

Move some touch logic to the `handler` base class
This commit is contained in:
Bart van den Eijnden
2013-04-25 07:42:39 -07:00
9 changed files with 124 additions and 111 deletions

View File

@@ -113,12 +113,6 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
*/
pixelTolerance: 5,
/**
* Property: touch
* {Boolean} Indcates the support of touch events.
*/
touch: false,
/**
* Property: lastTouchPx
* {<OpenLayers.Pixel>} The last pixel used to know the distance between
@@ -216,7 +210,6 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
this.layer.destroy(false);
}
this.layer = null;
this.touch = false;
return true;
},
@@ -383,18 +376,7 @@ OpenLayers.Handler.Point = OpenLayers.Class(OpenLayers.Handler, {
* {Boolean} Allow event propagation
*/
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,
dblclick: this.dblclick,
scope: this
});
}
this.startTouch();
this.lastTouchPx = evt.xy;
return this.down(evt);
},