Fixing the sizing issues with the popups -- all this time, the 'size' parameter we were passing in to init a popup has been the *content* size, not the actual size of the popup. This confusion has stemmed from the fact that we weren't ever differentiating between the two. Now we are. Rename that parameter 'contentSize' in all the constructors. NOTE that this does not *break* API, it is merely renaming a variable. As such, no one should see any difference... other than the fact that autosized popups now stay their correct size when opened and closed repeatedly. Big thanks to jpulles for finding this bug and filing an accurate, informative, and detailed bug report. Thanks to ahocevar and crschmidt for reviewing. (Closes #1586)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7897 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -85,7 +85,7 @@ OpenLayers.Popup.Framed =
|
||||
* Parameters:
|
||||
* id - {String}
|
||||
* lonlat - {<OpenLayers.LonLat>}
|
||||
* size - {<OpenLayers.Size>}
|
||||
* contentSize - {<OpenLayers.Size>}
|
||||
* contentHTML - {String}
|
||||
* anchor - {Object} Object to which we'll anchor the popup. Must expose
|
||||
* a 'size' (<OpenLayers.Size>) and 'offset' (<OpenLayers.Pixel>)
|
||||
@@ -93,7 +93,7 @@ OpenLayers.Popup.Framed =
|
||||
* closeBox - {Boolean}
|
||||
* closeBoxCallback - {Function} Function to be called on closeBox click.
|
||||
*/
|
||||
initialize:function(id, lonlat, size, contentHTML, anchor, closeBox,
|
||||
initialize:function(id, lonlat, contentSize, contentHTML, anchor, closeBox,
|
||||
closeBoxCallback) {
|
||||
|
||||
OpenLayers.Popup.Anchored.prototype.initialize.apply(this, arguments);
|
||||
@@ -188,9 +188,10 @@ OpenLayers.Popup.Framed =
|
||||
* of the popup has changed.
|
||||
*
|
||||
* Parameters:
|
||||
* size - {<OpenLayers.Size>}
|
||||
* contentSize - {<OpenLayers.Size>} the new size for the popup's
|
||||
* contents div (in pixels).
|
||||
*/
|
||||
setSize:function(size) {
|
||||
setSize:function(contentSize) {
|
||||
OpenLayers.Popup.Anchored.prototype.setSize.apply(this, arguments);
|
||||
|
||||
this.updateBlocks();
|
||||
@@ -296,7 +297,7 @@ OpenLayers.Popup.Framed =
|
||||
this.createBlocks();
|
||||
}
|
||||
|
||||
if (this.relativePosition) {
|
||||
if (this.size && this.relativePosition) {
|
||||
var position = this.positionBlocks[this.relativePosition];
|
||||
for (var i = 0; i < position.blocks.length; i++) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user