OpenLayers OpenLayers

Changeset 7656

Show
Ignore:
Timestamp:
08/01/08 01:06:30 (4 months ago)
Author:
euzuro
Message:

backing out patch for r7647 as it breaks framedcloud popups. (See #1586)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Popup.js

    r7647 r7656  
    4949 
    5050    /**  
    51      * Property: contentSize  
    52      * {<OpenLayers.Size>} the width and height of the content. 
    53      */ 
    54     contentSize: null,     
    55  
    56     /**  
    5751     * Property: size  
    5852     * {<OpenLayers.Size>} the width and height of the popup. 
     
    178172    * lonlat - {<OpenLayers.LonLat>}  The position on the map the popup will 
    179173    *                                 be shown. 
    180     * contentSize - {<OpenLayers.Size>}      The size of the content
     174    * size - {<OpenLayers.Size>}      The size of the popup
    181175    * contentHTML - {String}          The HTML content to display inside the  
    182176    *                                 popup. 
     
    185179    * closeBoxCallback - {Function}   Function to be called on closeBox click. 
    186180    */ 
    187     initialize:function(id, lonlat, contentSize, contentHTML, closeBox, closeBoxCallback) { 
     181    initialize:function(id, lonlat, size, contentHTML, closeBox, closeBoxCallback) { 
    188182        if (id == null) { 
    189183            id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_"); 
     
    192186        this.id = id; 
    193187        this.lonlat = lonlat; 
    194          
    195         this.contentSize = (contentSize != null) ? contentSize  
     188        this.size = (size != null) ? size  
    196189                                  : new OpenLayers.Size( 
    197190                                                   OpenLayers.Popup.WIDTH, 
    198191                                                   OpenLayers.Popup.HEIGHT); 
    199          
    200192        if (contentHTML != null) {  
    201193             this.contentHTML = contentHTML; 
     
    215207 
    216208        var id = this.div.id + "_contentDiv"; 
    217         this.contentDiv = OpenLayers.Util.createDiv(id, null, this.contentSize.clone(),  
     209        this.contentDiv = OpenLayers.Util.createDiv(id, null, this.size.clone(),  
    218210                                                    null, "relative"); 
    219211        this.contentDiv.className = 'olPopupContent';                                             
     
    307299 
    308300        this.moveTo(px); 
    309         if (!this.autoSize && !this.size) { 
    310             this.setSize(this.contentSize); 
     301        if (!this.autoSize) { 
     302            this.setSize(this.size); 
    311303        } 
    312304        this.setBackgroundColor(); 
     
    399391     *     (in pixels). 
    400392     */ 
    401     setSize:function(contentSize) {  
    402         this.size = contentSize.clone();  
     393    setSize:function(size) {  
     394        this.size = size;  
     395 
     396        var contentSize = this.size.clone(); 
    403397         
    404398        // if our contentDiv has a css 'padding' set on it by a stylesheet, we  
     
    428422        // me want to shoot someone, but so it goes. 
    429423        if (OpenLayers.Util.getBrowserName() == "msie") { 
    430             this.contentSize.w += contentDivPadding.left + contentDivPadding.right; 
    431             this.contentSize.h += contentDivPadding.bottom + contentDivPadding.top; 
     424            contentSize.w += contentDivPadding.left + contentDivPadding.right; 
     425            contentSize.h += contentDivPadding.bottom + contentDivPadding.top; 
    432426        } 
    433427 
  • trunk/openlayers/lib/OpenLayers/Popup/Anchored.js

    r7647 r7656  
    165165    calculateNewPx:function(px) { 
    166166        var newPx = px.offset(this.anchor.offset); 
    167          
    168         //use contentSize if size is not already set 
    169         var size = this.size || this.contentSize; 
    170167 
    171168        var top = (this.relativePosition.charAt(0) == 't'); 
    172         newPx.y += (top) ? -size.h : this.anchor.size.h; 
     169        newPx.y += (top) ? -this.size.h : this.anchor.size.h; 
    173170         
    174171        var left = (this.relativePosition.charAt(1) == 'l'); 
    175         newPx.x += (left) ? -size.w : this.anchor.size.w; 
     172        newPx.x += (left) ? -this.size.w : this.anchor.size.w; 
    176173 
    177174        return newPx;    
  • trunk/openlayers/tests/Popup.html

    r7647 r7656  
    1717             "valid default popupid"); 
    1818        var firstID = popup.id; 
    19         t.ok(popup.contentSize.equals(size), "good default popup.size"); 
     19        t.ok(popup.size.equals(size), "good default popup.size"); 
    2020        t.eq(popup.contentHTML, "", "good default popup.contentHTML"); 
    2121        t.eq(popup.backgroundColor, OpenLayers.Popup.COLOR, "good default popup.backgroundColor"); 
     
    5555        t.eq(popup.id, id, "popup.id set correctly"); 
    5656        t.ok(popup.lonlat.equals(ll), "popup.lonlat set correctly"); 
    57         t.ok(popup.contentSize.equals(sz), "popup.size set correctly"); 
     57        t.ok(popup.size.equals(sz), "popup.size set correctly"); 
    5858        t.eq(popup.contentHTML, content, "contentHTML porpoerty of set correctly"); 
    5959