fixing bug introduced with r1134

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1172 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-08-09 20:10:10 +00:00
parent 6efaf328e5
commit b2ab65df12

View File

@@ -125,11 +125,9 @@ OpenLayers.Control.LayerSwitcher.prototype =
var labelSpan = document.createElement("span");
labelSpan.innerHTML = layer.name;
labelSpan.style.verticalAlign = (baseLayer) ? "bottom" : "auto";
if (!(baseLayer && checked)) {
Event.observe(labelSpan,
"click",
this.onLabelClick.bindAsEventListener(inputElem));
}
// create line break
var br = document.createElement("br");
@@ -161,7 +159,10 @@ OpenLayers.Control.LayerSwitcher.prototype =
* @param {Event} e
*/
onLabelClick: function(e) {
var clickedRadioButton = ((this.type == "radio") && (this.checked));
if (!clickedRadioButton) {
this.checked = !this.checked;
}
},
/** Need to update the map accordingly whenever user clicks in either of