Restore drag handler state in deactivate. r=erilem (closes #3218)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11808 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user