Add patch for #726 for TOGGLE controls to control panels (patch from

Andreas Hocevar).


git-svn-id: http://svn.openlayers.org/trunk/openlayers@3207 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-05-30 13:51:28 +00:00
parent 96d8790258
commit b8d2aa5539

View File

@@ -103,7 +103,15 @@ OpenLayers.Control.Panel.prototype =
if (control.type == OpenLayers.Control.TYPE_BUTTON) {
control.trigger();
return;
}
}
if (control.type == OpenLayers.Control.TYPE_TOGGLE) {
if (control.active) {
control.deactivate();
} else {
control.activate();
}
return;
}
for (var i = 0; i < this.controls.length; i++) {
if (this.controls[i] == control) {
control.activate();