From a25f506f2078df7af049638602f7d23236b1952f Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Wed, 30 Mar 2011 20:53:46 +0000 Subject: [PATCH] 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 --- lib/OpenLayers/Handler/Click.js | 2 ++ tests/Handler/Click.html | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/OpenLayers/Handler/Click.js b/lib/OpenLayers/Handler/Click.js index 744d412f2e..3fb0f3748f 100644 --- a/lib/OpenLayers/Handler/Click.js +++ b/lib/OpenLayers/Handler/Click.js @@ -515,6 +515,8 @@ OpenLayers.Handler.Click = OpenLayers.Class(OpenLayers.Handler, { this.clearTimer(); this.down = null; this.first = null; + this.last = null; + this.touch = false; deactivated = true; } return deactivated; diff --git a/tests/Handler/Click.html b/tests/Handler/Click.html index 2dada5c7f5..41172cd896 100644 --- a/tests/Handler/Click.html +++ b/tests/Handler/Click.html @@ -410,7 +410,7 @@ } function test_Handler_Click_deactivate(t) { - t.plan(4); + t.plan(6); var control = { map: new OpenLayers.Map('map') }; @@ -422,6 +422,8 @@ handler.active = true; handler.down = true; handler.timerId = true; + handler.touch = true; + handler.last = true; deactivated = handler.deactivate(); t.ok(deactivated, "deactivate returns true if the handler was active already"); @@ -429,6 +431,11 @@ "deactivate sets down to null"); t.eq(handler.timerId, 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) {