reverting r12228 and r12185 (closes #3431)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@12231 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2011-08-10 08:35:27 +00:00
parent cc5818d4c7
commit 94c1c7906c
11 changed files with 182 additions and 44 deletions

View File

@@ -347,17 +347,9 @@ OpenLayers.Layer = OpenLayers.Class({
this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
this.div = OpenLayers.Util.createDiv(this.id);
var style = this.div.style;
style.width = "100%";
style.height = "100%";
style.overflow = "";
this.div.className = "olLayerDiv";
this.div.style.width = "100%";
this.div.style.height = "100%";
this.div.dir = "ltr";
if (this.opacity != null && this.opacity < 1) {
OpenLayers.Util.modifyDOMElement(
this.div, null, null, null, null, null, null, this.opacity
);
}
this.events = new OpenLayers.Events(this, this.div,
this.EVENT_TYPES);
@@ -370,19 +362,6 @@ OpenLayers.Layer = OpenLayers.Class({
if (this.wrapDateLine) {
this.displayOutsideMaxExtent = true;
}
//TODO remove the if block below when we drop support for IE8.
if (parseInt(navigator.appVersion.split("MSIE")[1], 10) == 8) {
// Workaround for opacity handling in IE8 - also see
// .ie8-opacity-hack selectors in theme/default/style.css
this.events.register("loadend", this, function() {
var opacity = this.opacity;
if (opacity != null && opacity >= 0 && opacity < 1) {
OpenLayers.Element.addClass(this.div, "ie8-opacity-hack");
this.div.style.filter = "alpha(opacity=" + (opacity * 100) + ")";
}
});
}
},
/**
@@ -1291,8 +1270,11 @@ OpenLayers.Layer = OpenLayers.Class({
setOpacity: function(opacity) {
if (opacity != this.opacity) {
this.opacity = opacity;
OpenLayers.Util.modifyDOMElement(this.div, null, null, null,
null, null, null, opacity);
for(var i=0, len=this.div.childNodes.length; i<len; ++i) {
var element = this.div.childNodes[i].firstChild;
OpenLayers.Util.modifyDOMElement(element, null, null, null,
null, null, null, opacity);
}
if (this.map != null) {
this.map.events.triggerEvent("changelayer", {
layer: this,