diff --git a/lib/OpenLayers/Handler/Drag.js b/lib/OpenLayers/Handler/Drag.js index 037a88ef19..36291edf98 100644 --- a/lib/OpenLayers/Handler/Drag.js +++ b/lib/OpenLayers/Handler/Drag.js @@ -145,6 +145,7 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, { }; } }, + /** * Method: dragstart @@ -507,6 +508,7 @@ 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; diff --git a/tests/Handler/Drag.html b/tests/Handler/Drag.html index a32fa6288f..4be1df9e6d 100644 --- a/tests/Handler/Drag.html +++ b/tests/Handler/Drag.html @@ -416,7 +416,7 @@ } function test_Handler_Drag_deactivate(t) { - t.plan(6); + t.plan(7); var map = new OpenLayers.Map('map'); var control = new OpenLayers.Control(); map.addControl(control); @@ -427,6 +427,7 @@ "deactivate returns false if the handler was not already active"); handler.active = true; handler.dragging = true; + handler.touch = true; deactivated = handler.deactivate(); t.ok(deactivated, "deactivate returns true if the handler was active already"); @@ -437,7 +438,9 @@ t.ok(handler.start == null, "deactivate sets start to null"); t.ok(handler.last == null, - "deactivate sets start to null"); + "deactivate sets last to null"); + t.ok(!handler.touch, + "deactivate sets touch to false"); } function test_interval_timer_after_mouseup(t) {