OpenLayers OpenLayers

Changeset 6651

Show
Ignore:
Timestamp:
03/28/08 01:38:08 (10 months ago)
Author:
euzuro
Message:

straighten things out once and for all in framed world regarding relative positioning. now that the underclasses (gofigure) are working as expected, we can too. the only time we need to bother ourselves is when there has been a moveTo(), not on a setSize() (since that function will automatically call moveTo()). now our calculateRelativePosition() is functioning correctly -- it doesn't update anything, it only just returns the relative position. the updating gets taken care of in moveTo(), just as it should.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/euzuro/pop/lib/OpenLayers/Popup/Framed.js

    r6647 r6651  
    9494            //based on our decided relativePostion, set the current padding 
    9595            // this keeps us from getting into trouble  
    96             this.updateRelativePosition(this.relativePosition); 
     96            this.updateRelativePosition(); 
    9797        } 
    9898 
     
    151151    }, 
    152152 
    153     /**  
    154      * APIMethod: setSize 
    155      *  
    156      * Parameters: 
    157      * size {OpenLayers.Size} - Desired size of the content of the popup. 
    158      */ 
    159     setSize: function(size) { 
    160  
    161         OpenLayers.Popup.Anchored.prototype.setSize.apply(this, arguments); 
    162          
    163         this.updateFrames(); 
     153    /** 
     154     * APIMethod: moveTo 
     155     *  
     156     * Parameters: 
     157     * px - {<OpenLayers.Pixel>} 
     158     */ 
     159    moveTo: function(px) { 
     160        OpenLayers.Popup.Anchored.prototype.moveTo.apply(this, arguments); 
     161 
     162        this.updateRelativePosition(); 
    164163    }, 
    165164     
     
    196195            relativePosition =  
    197196                OpenLayers.Popup.Anchored.prototype.calculateRelativePosition.apply(this, arguments); 
    198  
    199             //update the frame's padding and offset for the new  
    200             // relative position 
    201             this.updateRelativePosition(relativePosition); 
    202197        } 
    203198 
     
    207202    /** 
    208203     * Method: updateRelativePosition 
    209      *  
    210      * Parameters: 
    211      * relativePosition - {String}} 
    212      */ 
    213     updateRelativePosition: function(relativePosition) { 
    214          
     204     */ 
     205    updateRelativePosition: function() { 
     206 
    215207        //update the padding 
    216         this.padding = this.positionBlocks[relativePosition].padding; 
     208        this.padding = this.positionBlocks[this.relativePosition].padding; 
    217209         
    218210        //update the position of our close box to new padding 
     
    227219                                      this.padding.top + "px"; 
    228220        }         
     221 
     222        this.updateFrames(); 
    229223    }, 
    230224