OpenLayers OpenLayers

Changeset 6582

Show
Ignore:
Timestamp:
03/25/08 15:34:22 (8 months ago)
Author:
euzuro
Message:

allow the fixing of one of the dimensions when requesting the rendered dimensions of a div from OpenLayers.Util.getRenderedDimensions()

Files:

Legend:

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

    r6579 r6582  
    13331333 *     scrollbars do not flicker 
    13341334 *      
     1335 * Parameters: 
     1336 * size - {<OpenLayers.Size>} If either the 'w' or 'h' properties is  
     1337 *     specified, we fix that dimension of the div to be measured. This is  
     1338 *     useful in the case where we have a limit in one dimension and must  
     1339 *     therefore meaure the flow in the other dimension. 
     1340 *  
    13351341 * Returns: 
    13361342 * {OpenLayers.Size} 
    13371343 */ 
    1338 OpenLayers.Util.getRenderedDimensions = function(contentHTML) { 
     1344OpenLayers.Util.getRenderedDimensions = function(contentHTML, size) { 
    13391345     
    13401346    // create temp container div with restricted size 
     
    13441350    container.style.left = "-9999px"; 
    13451351         
     1352    //fix a dimension, if specified. 
     1353    if (size) { 
     1354        if (size.w) { 
     1355            container.style.width = size.w; 
     1356        } else if (size.h) { 
     1357            container.style.height = size.h; 
     1358        } 
     1359    } 
     1360     
    13461361    // create temp content div and assign content 
    13471362    var content = document.createElement("div");