If a mouseup is not preceeded by a mousedown *inside the layerswitcher*,

then the mouseup should be allowed to drop through to the map, since it
may have started as part of a drag action.


git-svn-id: http://svn.openlayers.org/branches/openlayers/2.0@1329 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-08-22 13:09:53 +00:00
parent abfbe30b2b
commit 402021f24f

View File

@@ -119,6 +119,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
inputElem.type = (baseLayer) ? "radio" : "checkbox";
inputElem.value = layer.name;
inputElem.checked = checked;
inputElem.checked = checked;
inputElem.layer = layer;
inputElem.control = this;
Event.observe(inputElem, "mouseup",
@@ -161,8 +162,9 @@ OpenLayers.Control.LayerSwitcher.prototype =
*/
onInputClick: function(e) {
var clickedRadioButton = ((this.type == "radio") && (this.checked));
if (!clickedRadioButton) {
if (this.type == "radio") {
this.checked = true;
} else {
this.checked = !this.checked;
}
Event.stop(e);
@@ -274,11 +276,11 @@ OpenLayers.Control.LayerSwitcher.prototype =
this.div.style.backgroundColor = "transparent";
Event.observe(this.div, "mouseup",
this.ignoreEvent);
this.mouseUp.bindAsEventListener(this));
Event.observe(this.div, "click",
this.ignoreEvent);
Event.observe(this.div, "mousedown",
this.ignoreEvent);
this.mouseDown.bindAsEventListener(this));
Event.observe(this.div, "dblclick", this.ignoreEvent);