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:
@@ -59,13 +59,6 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, {
|
||||
* {<OpenLayers.Pixel>} The location of the last mouseup.
|
||||
*/
|
||||
up: null,
|
||||
|
||||
/**
|
||||
* Property: touch
|
||||
* {Boolean} When a touchstart event is fired, touch will be true and all
|
||||
* mouse related listeners will do nothing.
|
||||
*/
|
||||
touch: false,
|
||||
|
||||
/**
|
||||
* Property: clickTolerance
|
||||
@@ -139,17 +132,7 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, {
|
||||
* {Boolean} Let the event propagate.
|
||||
*/
|
||||
touchstart: function(evt) {
|
||||
if(!this.touch) {
|
||||
this.touch = true;
|
||||
this.map.events.un({
|
||||
mousedown: this.mousedown,
|
||||
mouseup: this.mouseup,
|
||||
mousemove: this.mousemove,
|
||||
click: this.click,
|
||||
dblclick: this.dblclick,
|
||||
scope: this
|
||||
});
|
||||
}
|
||||
this.startTouch();
|
||||
return OpenLayers.Event.isMultiTouch(evt) ?
|
||||
true : this.mousedown(evt);
|
||||
},
|
||||
@@ -398,7 +381,6 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, {
|
||||
this.lastFeature = null;
|
||||
this.down = null;
|
||||
this.up = null;
|
||||
this.touch = false;
|
||||
this.map.events.un({
|
||||
"removelayer": this.handleMapEvents,
|
||||
"changelayer": this.handleMapEvents,
|
||||
|
||||
Reference in New Issue
Block a user