Restore click handler state in deactivate. r=erilem (closes #3217)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@11807 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2011-03-30 20:53:46 +00:00
parent 5fc138f69b
commit a25f506f20
2 changed files with 10 additions and 1 deletions
+2
View File
@@ -515,6 +515,8 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, {
this.clearTimer(); this.clearTimer();
this.down = null; this.down = null;
this.first = null; this.first = null;
this.last = null;
this.touch = false;
deactivated = true; deactivated = true;
} }
return deactivated; return deactivated;
+8 -1
View File
@@ -410,7 +410,7 @@
} }
function test_Handler_Click_deactivate(t) { function test_Handler_Click_deactivate(t) {
t.plan(4); t.plan(6);
var control = { var control = {
map: new OpenLayers.Map('map') map: new OpenLayers.Map('map')
}; };
@@ -422,6 +422,8 @@
handler.active = true; handler.active = true;
handler.down = true; handler.down = true;
handler.timerId = true; handler.timerId = true;
handler.touch = true;
handler.last = true;
deactivated = handler.deactivate(); deactivated = handler.deactivate();
t.ok(deactivated, t.ok(deactivated,
"deactivate returns true if the handler was active already"); "deactivate returns true if the handler was active already");
@@ -429,6 +431,11 @@
"deactivate sets down to null"); "deactivate sets down to null");
t.eq(handler.timerId, null, t.eq(handler.timerId, null,
"deactivate sets timerId to null"); "deactivate sets timerId to null");
t.eq(handler.touch, false,
"deactivate sets touch to false");
t.eq(handler.last, null,
"deactivate sets last to null");
} }
function test_Handler_Click_mouseup(t) { function test_Handler_Click_mouseup(t) {