Merged r1559:r1587 from source:/sandbox/crschmidt/noprototype. OpenLayers is now Prototype-free(tm).

git-svn-id: http://svn.openlayers.org/trunk/openlayers@1588 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2006-10-05 14:50:47 +00:00
parent 33c37ef78b
commit 67ced536c0
51 changed files with 688 additions and 1963 deletions
+16 -15
View File
@@ -7,9 +7,9 @@
*
* @requires OpenLayers/Control.js
*/
OpenLayers.Control.LayerSwitcher = Class.create();
OpenLayers.Control.LayerSwitcher = OpenLayers.Class.create();
OpenLayers.Control.LayerSwitcher.prototype =
Object.extend( new OpenLayers.Control(), {
OpenLayers.Util.extend( new OpenLayers.Control(), {
/** @type String */
activeColor: "darkblue",
@@ -129,10 +129,11 @@ OpenLayers.Control.LayerSwitcher.prototype =
inputElem.defaultChecked = checked;
inputElem.layer = layer;
inputElem.control = this;
if (!baseLayer && !layer.inRange()) {
inputElem.disabled = true;
}
Event.observe(inputElem, "mouseup",
OpenLayers.Event.observe(inputElem, "mouseup",
this.onInputClick.bindAsEventListener(inputElem));
// create span
@@ -142,7 +143,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
}
labelSpan.innerHTML = layer.name;
labelSpan.style.verticalAlign = (baseLayer) ? "bottom" : "baseline";
Event.observe(labelSpan, "click",
OpenLayers.Event.observe(labelSpan, "click",
this.onInputClick.bindAsEventListener(inputElem));
// create line break
var br = document.createElement("br");
@@ -185,7 +186,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
this.control.updateMap();
}
}
Event.stop(e);
OpenLayers.Event.stop(e);
},
/** Need to update the map accordingly whenever user clicks in either of
@@ -237,7 +238,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
this.showControls(false);
if (e != null) {
Event.stop(e);
OpenLayers.Event.stop(e);
}
},
@@ -254,7 +255,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
this.showControls(true);
if (e != null) {
Event.stop(e);
OpenLayers.Event.stop(e);
}
},
@@ -292,13 +293,13 @@ OpenLayers.Control.LayerSwitcher.prototype =
this.div.style.color = "white";
this.div.style.backgroundColor = "transparent";
Event.observe(this.div, "mouseup",
OpenLayers.Event.observe(this.div, "mouseup",
this.mouseUp.bindAsEventListener(this));
Event.observe(this.div, "click",
OpenLayers.Event.observe(this.div, "click",
this.ignoreEvent);
Event.observe(this.div, "mousedown",
OpenLayers.Event.observe(this.div, "mousedown",
this.mouseDown.bindAsEventListener(this));
Event.observe(this.div, "dblclick", this.ignoreEvent);
OpenLayers.Event.observe(this.div, "dblclick", this.ignoreEvent);
// layers list div
@@ -325,7 +326,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
this.baseLayersDiv = document.createElement("div");
this.baseLayersDiv.style.paddingLeft = "10px";
/*Event.observe(this.baseLayersDiv, "click",
/*OpenLayers.Event.observe(this.baseLayersDiv, "click",
this.onLayerClick.bindAsEventListener(this));
*/
@@ -375,7 +376,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
this.maximizeDiv.style.right = "0px";
this.maximizeDiv.style.left = "";
this.maximizeDiv.style.display = "none";
Event.observe(this.maximizeDiv,
OpenLayers.Event.observe(this.maximizeDiv,
"click",
this.maximizeControl.bindAsEventListener(this));
@@ -394,7 +395,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
this.minimizeDiv.style.right = "0px";
this.minimizeDiv.style.left = "";
this.minimizeDiv.style.display = "none";
Event.observe(this.minimizeDiv,
OpenLayers.Event.observe(this.minimizeDiv,
"click",
this.minimizeControl.bindAsEventListener(this));
@@ -407,7 +408,7 @@ OpenLayers.Control.LayerSwitcher.prototype =
* @param {Event} evt
*/
ignoreEvent: function(evt) {
Event.stop(evt);
OpenLayers.Event.stop(evt);
},
/** Register a local 'mouseDown' flag so that we'll know whether or not