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