OpenLayers OpenLayers

Changeset 6684

Show
Ignore:
Timestamp:
03/28/08 21:44:13 (10 months ago)
Author:
euzuro
Message:

when we have a fixedrelativeposition, we should just overwrite the calculaterelativeposition() function at the very beginning. no reason to do this dynamically (and confuse people). this property will not change dynamically. /me shaves 19 lines of code

Files:

Legend:

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

    r6683 r6684  
    103103            // this keeps us from getting into trouble  
    104104            this.updateRelativePosition(); 
     105             
     106            //make calculateRelativePosition always returnt the specified 
     107            // fiexed position. 
     108            this.calculateRelativePosition = function(px) { 
     109                return this.relativePosition; 
     110            }; 
    105111        } 
    106112 
     
    161167 
    162168        this.updateBlocks(); 
    163     }, 
    164  
    165     /**  
    166      * Method: calculateRelativePosition 
    167      * Because we want to give the Framed the ability to *not* be  
    168      *     positioned relative to its anchor (ie always "tr"), we overrride 
    169      *     this function from the Anchored popup and only actually make the  
    170      *     call to the superclass if the 'fixedRelativePosition' property is  
    171      *     false. 
    172      *  
    173      * Parameters: 
    174      * px - {<OpenLayers.Pixel>} 
    175      *  
    176      * Returns: 
    177      * {String} The relative position ("br" "tr" "tl "bl") at which the popup 
    178      *     should be placed. 
    179      */ 
    180     calculateRelativePosition: function(px) { 
    181         var relativePosition = this.relativePosition; 
    182         if (!this.fixedRelativePosition) { 
    183             relativePosition =  
    184                 OpenLayers.Popup.Anchored.prototype.calculateRelativePosition.apply(this, arguments); 
    185         } 
    186  
    187         return relativePosition; 
    188169    }, 
    189170