Skip to content

Commit

Permalink
Merge pull request openlayers#432 from ahocevar/iframe-opacity
Browse files Browse the repository at this point in the history
Long URLs messing up Opacity. r=@elemoine,@lewinmadrid
  • Loading branch information
ahocevar committed Apr 24, 2012
2 parents 07533fc + fc0b15a commit f4a77ca
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/OpenLayers/Layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,11 @@ OpenLayers.Layer = OpenLayers.Class({
var childNodes = this.div.childNodes;
for(var i = 0, len = childNodes.length; i < len; ++i) {
var element = childNodes[i].firstChild || childNodes[i];
var lastChild = childNodes[i].lastChild;
//TODO de-uglify this
if (lastChild && lastChild.nodeName.toLowerCase() === "iframe") {
element = lastChild.parentNode;
}
OpenLayers.Util.modifyDOMElement(element, null, null, null,
null, null, null, opacity);
}
Expand Down
13 changes: 13 additions & 0 deletions lib/OpenLayers/Tile/Image/IFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,19 @@ OpenLayers.Tile.Image.IFrame = {
OpenLayers.Tile.Image.prototype.setImgSrc.apply(this, arguments);
}
},

/**
* Method: onImageLoad
* Handler for the image onload event
*/
onImageLoad: function() {
//TODO de-uglify opacity handling
OpenLayers.Tile.Image.prototype.onImageLoad.apply(this, arguments);
if (this.useIFrame === true) {
this.imgDiv.style.opacity = 1;
this.frame.style.opacity = this.layer.opacity;
}
},

/**
* Method: createBackBuffer
Expand Down

0 comments on commit f4a77ca

Please sign in to comment.