OpenLayers OpenLayers

Ticket #1479: createBlocks.patch

File createBlocks.patch, 1.6 kB (added by crschmidt, 9 months ago)
  • tests/list-tests.html

    old new  
    4040    <li>Popup.html</li> 
    4141    <li>Popup/Anchored.html</li> 
    4242    <li>Popup/AnchoredBubble.html</li> 
     43    <li>Popup/FramedCloud.html</li> 
    4344    <li>Feature.html</li> 
    4445    <li>Feature/Vector.html</li> 
    4546    <li>Style.html</li> 
  • lib/OpenLayers/Popup/Framed.js

    old new  
    248248     * Method: createBlocks 
    249249     */ 
    250250    createBlocks: function() { 
     251        if (!this.relativePosition) { 
     252            // this.relativePosition can't be set until we have a map 
     253            // set: if it's not set, we can't create blocks. (See #1479)  
     254            return false;  
     255        }     
     256         
    251257        this.blocks = []; 
    252258 
    253259        var position = this.positionBlocks[this.relativePosition]; 
     
    274280            block.div.appendChild(block.image); 
    275281            this.groupDiv.appendChild(block.div); 
    276282        } 
     283         
     284        return true; 
    277285    }, 
    278286 
    279287    /** 
     
    285293    updateBlocks: function() { 
    286294 
    287295        if (!this.blocks) { 
    288             this.createBlocks(); 
     296            var cont = this.createBlocks(); 
    289297        } 
    290  
     298         
     299        if (!cont) { 
     300            return false; 
     301        }     
     302         
    291303        var position = this.positionBlocks[this.relativePosition]; 
    292304        for (var i = 0; i < position.blocks.length; i++) { 
    293305