Pullup commits from trunk to 2.6 branch:

* virtualStyle typo (Closes #1495)
 * JSON fix for Safari 3.1 (Closes #1493)
 * panzoombar off-by-one (Closes #1486)
 * Handler Hover exception (Closes #1480)
 * Popup.framedcloud exception (Closes #1479)
 * VML Renderer when including namespace in page (Closes #1477)
 * SLD/Rule/Filter changes -- most of this commit (Closes #1492)


git-svn-id: http://svn.openlayers.org/branches/openlayers/2.6@6819 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2008-04-08 01:51:04 +00:00
parent b9348dd5d5
commit 4085a2c220
29 changed files with 842 additions and 665 deletions

View File

@@ -250,7 +250,16 @@ OpenLayers.Popup.Framed =
createBlocks: function() {
this.blocks = [];
var position = this.positionBlocks[this.relativePosition];
//since all positions contain the same number of blocks, we can
// just pick the first position and use its blocks array to create
// our blocks array
var firstPosition = null;
for(var key in this.positionBlocks) {
firstPosition = key;
break;
}
var position = this.positionBlocks[firstPosition];
for (var i = 0; i < position.blocks.length; i++) {
var block = {};
@@ -283,48 +292,49 @@ OpenLayers.Popup.Framed =
* the popup's blocks in their appropropriate places.
*/
updateBlocks: function() {
if (!this.blocks) {
this.createBlocks();
}
var position = this.positionBlocks[this.relativePosition];
for (var i = 0; i < position.blocks.length; i++) {
var positionBlock = position.blocks[i];
var block = this.blocks[i];
// adjust sizes
var l = positionBlock.anchor.left;
var b = positionBlock.anchor.bottom;
var r = positionBlock.anchor.right;
var t = positionBlock.anchor.top;
//note that we use the isNaN() test here because if the
// size object is initialized with a "auto" parameter, the
// size constructor calls parseFloat() on the string,
// which will turn it into NaN
//
var w = (isNaN(positionBlock.size.w)) ? this.size.w - (r + l)
: positionBlock.size.w;
var h = (isNaN(positionBlock.size.h)) ? this.size.h - (b + t)
: positionBlock.size.h;
block.div.style.width = w + 'px';
block.div.style.height = h + 'px';
block.div.style.left = (l != null) ? l + 'px' : '';
block.div.style.bottom = (b != null) ? b + 'px' : '';
block.div.style.right = (r != null) ? r + 'px' : '';
block.div.style.top = (t != null) ? t + 'px' : '';
block.image.style.left = positionBlock.position.x + 'px';
block.image.style.top = positionBlock.position.y + 'px';
if (this.relativePosition) {
var position = this.positionBlocks[this.relativePosition];
for (var i = 0; i < position.blocks.length; i++) {
var positionBlock = position.blocks[i];
var block = this.blocks[i];
// adjust sizes
var l = positionBlock.anchor.left;
var b = positionBlock.anchor.bottom;
var r = positionBlock.anchor.right;
var t = positionBlock.anchor.top;
//note that we use the isNaN() test here because if the
// size object is initialized with a "auto" parameter, the
// size constructor calls parseFloat() on the string,
// which will turn it into NaN
//
var w = (isNaN(positionBlock.size.w)) ? this.size.w - (r + l)
: positionBlock.size.w;
var h = (isNaN(positionBlock.size.h)) ? this.size.h - (b + t)
: positionBlock.size.h;
block.div.style.width = w + 'px';
block.div.style.height = h + 'px';
block.div.style.left = (l != null) ? l + 'px' : '';
block.div.style.bottom = (b != null) ? b + 'px' : '';
block.div.style.right = (r != null) ? r + 'px' : '';
block.div.style.top = (t != null) ? t + 'px' : '';
block.image.style.left = positionBlock.position.x + 'px';
block.image.style.top = positionBlock.position.y + 'px';
}
this.contentDiv.style.left = this.padding.left + "px";
this.contentDiv.style.top = this.padding.top + "px";
}
this.contentDiv.style.left = this.padding.left + "px";
this.contentDiv.style.top = this.padding.top + "px";
},
CLASS_NAME: "OpenLayers.Popup.Framed"