From 0d45c5f148567d1c16bcb7b4e9fdfcc4413917c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Lemoine?= Date: Tue, 10 May 2011 07:13:22 +0000 Subject: [PATCH] allow toggling TYPE_TOOL controls in panels, p=jorix, r=me (closes #3294) git-svn-id: http://svn.openlayers.org/trunk/openlayers@11965 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/Panel.js | 26 +++++++++++++++++++------- tests/Control/Panel.html | 26 ++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/lib/OpenLayers/Control/Panel.js b/lib/OpenLayers/Control/Panel.js index 215a4f0c60..b0955426c4 100644 --- a/lib/OpenLayers/Control/Panel.js +++ b/lib/OpenLayers/Control/Panel.js @@ -46,6 +46,14 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, { */ saveState: false, + /** + * APIProperty: allowDepress + * {Boolean} If is true the controls can + * be deactivated by clicking the icon that represents them. Default + * is false. + */ + allowDepress: false, + /** * Property: activeState * {Object} stores the active state of this panel's controls. @@ -199,15 +207,19 @@ OpenLayers.Control.Panel = OpenLayers.Class(OpenLayers.Control, { } return; } - var c; - for (var i=0, len=this.controls.length; i