Pullups for OL 2.8 RC3.
jQuery lib fix (Closes #1391) getRenderedSize regression (Closes #1906) element.scrolls error with panzoombar (Closes #2054) createUrlObject bug (Closes #2060) google layer in late rendered maps (Closes #2075) IE6/Lang.nb bug (Closes #2093) Layer.TMS/TileCache bugs (Closes #2099) (Closes #2100) Graphic names issues (Closes #2101) git-svn-id: http://svn.openlayers.org/branches/openlayers/2.8@9406 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -32,10 +32,10 @@ OpenLayers.Util.getElement = function() {
|
||||
};
|
||||
|
||||
/**
|
||||
* Maintain $() from prototype
|
||||
* Maintain existing definition of $.
|
||||
*/
|
||||
if ($ == null) {
|
||||
var $ = OpenLayers.Util.getElement;
|
||||
if(typeof window.$ === "undefined") {
|
||||
window.$ = OpenLayers.Util.getElement;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1346,7 +1346,21 @@ OpenLayers.Util.isEquivalentUrl = function(url1, url2, options) {
|
||||
OpenLayers.Util.createUrlObject = function(url, options) {
|
||||
options = options || {};
|
||||
|
||||
var urlObject = {};
|
||||
// deal with relative urls first
|
||||
if(!(/^\w+:\/\//).test(url)) {
|
||||
var loc = window.location;
|
||||
var port = loc.port ? ":" + loc.port : "";
|
||||
var fullUrl = loc.protocol + "//" + loc.host + port;
|
||||
if(url.indexOf("/") === 0) {
|
||||
// full pathname
|
||||
url = fullUrl + url;
|
||||
} else {
|
||||
// relative to current path
|
||||
var parts = loc.pathname.split("/");
|
||||
parts.pop();
|
||||
url = fullUrl + parts.join("/") + "/" + url;
|
||||
}
|
||||
}
|
||||
|
||||
if (options.ignoreCase) {
|
||||
url = url.toLowerCase();
|
||||
@@ -1355,13 +1369,15 @@ OpenLayers.Util.createUrlObject = function(url, options) {
|
||||
var a = document.createElement('a');
|
||||
a.href = url;
|
||||
|
||||
var urlObject = {};
|
||||
|
||||
//host (without port)
|
||||
// if we don't have a host (which is the case with URLs starting with "/"
|
||||
// in IE), take the window location's host to match other browsers that
|
||||
// fill in the window's location host automatically
|
||||
urlObject.host = a.host || window.location.host;
|
||||
var port = a.port;
|
||||
if (port.length <= 0) {
|
||||
if (port.length > 0) {
|
||||
var newHostLength = urlObject.host.length - (port.length);
|
||||
urlObject.host = urlObject.host.substring(0, newHostLength);
|
||||
}
|
||||
@@ -1540,9 +1556,7 @@ OpenLayers.Util.getRenderedDimensions = function(contentHTML, size, options) {
|
||||
|
||||
// create temp container div with restricted size
|
||||
var container = document.createElement("div");
|
||||
container.style.overflow= "";
|
||||
container.style.position = "absolute";
|
||||
container.style.left = "-9999px";
|
||||
container.style.visibility = "hidden";
|
||||
|
||||
var containerElement = (options && options.containerElement)
|
||||
? options.containerElement : document.body;
|
||||
@@ -1567,12 +1581,40 @@ OpenLayers.Util.getRenderedDimensions = function(contentHTML, size, options) {
|
||||
var content = document.createElement("div");
|
||||
content.innerHTML = contentHTML;
|
||||
|
||||
// we need overflow visible when calculating the size
|
||||
content.style.overflow = "visible";
|
||||
if (content.childNodes) {
|
||||
for (var i=0, l=content.childNodes.length; i<l; i++) {
|
||||
if (!content.childNodes[i].style) continue;
|
||||
content.childNodes[i].style.overflow = "visible";
|
||||
}
|
||||
}
|
||||
|
||||
// add content to restricted container
|
||||
container.appendChild(content);
|
||||
|
||||
// append container to body for rendering
|
||||
containerElement.appendChild(container);
|
||||
|
||||
// Opera and IE7 can't handle a node with position:aboslute if it inherits
|
||||
// position:absolute from a parent.
|
||||
var parentHasPositionAbsolute = false;
|
||||
var parent = container.parentNode;
|
||||
while (parent && parent.tagName.toLowerCase()!="body") {
|
||||
var parentPosition = OpenLayers.Element.getStyle(parent, "position");
|
||||
if(parentPosition == "absolute") {
|
||||
parentHasPositionAbsolute = true;
|
||||
break;
|
||||
} else if (parentPosition && parentPosition != "static") {
|
||||
break;
|
||||
}
|
||||
parent = parent.parentNode;
|
||||
}
|
||||
|
||||
if(!parentHasPositionAbsolute) {
|
||||
container.style.position = "absolute";
|
||||
}
|
||||
|
||||
// calculate scroll width of content and add corners and shadow width
|
||||
if (!w) {
|
||||
w = parseInt(content.scrollWidth);
|
||||
|
||||
Reference in New Issue
Block a user