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:
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user