Fix for non auto-size popups that were progressively expanding each time they were opened. a little investigation showed us that there was some unfortunate ambiguity with the 'size' property, which was alternatively being used as 'size' and 'contentSize'. cheers to seb for an elegant solution r=cr5,me (Closes #1586)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7647 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2008-07-31 20:40:00 +00:00
parent a2905538d8
commit c953579eb9
3 changed files with 25 additions and 16 deletions
+5 -2
View File
@@ -164,12 +164,15 @@ OpenLayers.Popup.Anchored =
*/
calculateNewPx:function(px) {
var newPx = px.offset(this.anchor.offset);
//use contentSize if size is not already set
var size = this.size || this.contentSize;
var top = (this.relativePosition.charAt(0) == 't');
newPx.y += (top) ? -this.size.h : this.anchor.size.h;
newPx.y += (top) ? -size.h : this.anchor.size.h;
var left = (this.relativePosition.charAt(1) == 'l');
newPx.x += (left) ? -this.size.w : this.anchor.size.w;
newPx.x += (left) ? -size.w : this.anchor.size.w;
return newPx;
},