replace useage of OpenLayers.Util.setOpacity() with OpenLayers.Util.modifyDOMElement(). Rewrite the former to use the latter, and mark the former as deprecated.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@1551 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -464,7 +464,8 @@ OpenLayers.Layer.prototype = {
|
||||
this.opacity = opacity;
|
||||
for(var i=0; i<this.div.childNodes.length; ++i) {
|
||||
var element = this.div.childNodes[i];
|
||||
OpenLayers.Util.setOpacity(element, opacity);
|
||||
OpenLayers.Util.modifyDOMElement(element, null, null, null,
|
||||
null, null, null, opacity);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -109,7 +109,10 @@ OpenLayers.Tile.Image.prototype =
|
||||
}
|
||||
this.layer.div.appendChild(this.imgDiv);
|
||||
if(this.layer.opacity != null) {
|
||||
OpenLayers.Util.setOpacity(this.imgDiv, this.layer.opacity);
|
||||
|
||||
OpenLayers.Util.modifyDOMElement(this.imgDiv, null, null, null,
|
||||
null, null, null,
|
||||
this.layer.opacity);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -134,6 +134,9 @@ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated -- Use OpenLayers.Util.modifyDOMElement() or
|
||||
* OpenLayers.Util.modifyAlphaImageDiv()
|
||||
*
|
||||
* Set the opacity of a DOM Element
|
||||
* Note that for this function to work in IE, elements must "have layout"
|
||||
* according to:
|
||||
@@ -143,8 +146,8 @@ OpenLayers.Util.createImage = function(id, px, sz, imgURL, position, border,
|
||||
* @param {Float} opacity Opacity value (0.0 - 1.0)
|
||||
*/
|
||||
OpenLayers.Util.setOpacity = function(element, opacity) {
|
||||
element.style.opacity = opacity;
|
||||
element.style.filter = 'alpha(opacity=' + (opacity * 100) + ')';
|
||||
OpenLayers.Util.modifyDOMElement(element, null, null, null,
|
||||
null, null, null, opacity);
|
||||
}
|
||||
|
||||
OpenLayers.Util.onImageLoad = function() {
|
||||
|
||||
Reference in New Issue
Block a user