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:
@@ -50,13 +50,6 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
|
||||
*/
|
||||
dragging: false,
|
||||
|
||||
/**
|
||||
* Property: touch
|
||||
* {Boolean} When a touchstart event is fired, touch will be true and all
|
||||
* mouse related listeners will do nothing.
|
||||
*/
|
||||
touch: false,
|
||||
|
||||
/**
|
||||
* Property: last
|
||||
* {<OpenLayers.Pixel>} The last pixel location of the drag.
|
||||
@@ -345,17 +338,7 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
|
||||
* {Boolean} Let the event propagate.
|
||||
*/
|
||||
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,
|
||||
scope: this
|
||||
});
|
||||
}
|
||||
this.startTouch();
|
||||
return this.dragstart(evt);
|
||||
},
|
||||
|
||||
@@ -509,7 +492,6 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
|
||||
deactivate: function() {
|
||||
var deactivated = false;
|
||||
if(OpenLayers.Handler.prototype.deactivate.apply(this, arguments)) {
|
||||
this.touch = false;
|
||||
this.started = false;
|
||||
this.dragging = false;
|
||||
this.start = null;
|
||||
|
||||
Reference in New Issue
Block a user