Ticket #1479: createBlocks.3.patch
| File createBlocks.3.patch, 2.3 kB (added by crschmidt, 9 months ago) |
|---|
-
tests/Popup/FramedCloud.html
old new 1 <html> 2 <head> 3 <script src="../../lib/OpenLayers.js"></script> 4 <script type="text/javascript"> 5 6 function test_Popup_FramedCloud_setHTML(t) { 7 t.plan(1); 8 popup = new OpenLayers.Popup.FramedCloud(); 9 popup.setContentHTML("<p></p>"); 10 t.ok("setHTML on popup not yet added to map doesn't fail"); 11 } 12 13 </script> 14 </head> 15 <body> 16 <div id="map" style="width:512px; height:256px"> </div> 17 </body> 18 </html> -
tests/list-tests.html
old new 40 40 <li>Popup.html</li> 41 41 <li>Popup/Anchored.html</li> 42 42 <li>Popup/AnchoredBubble.html</li> 43 <li>Popup/FramedCloud.html</li> 43 44 <li>Feature.html</li> 44 45 <li>Feature/Vector.html</li> 45 46 <li>Style.html</li> -
lib/OpenLayers/Popup/Framed.js
old new 248 248 * Method: createBlocks 249 249 */ 250 250 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 251 257 this.blocks = []; 252 258 253 259 var position = this.positionBlocks[this.relativePosition]; … … 274 280 block.div.appendChild(block.image); 275 281 this.groupDiv.appendChild(block.div); 276 282 } 283 284 return true; 277 285 }, 278 286 279 287 /** … … 283 291 * the popup's blocks in their appropropriate places. 284 292 */ 285 293 updateBlocks: function() { 286 287 294 if (!this.blocks) { 288 this.createBlocks(); 295 var cont = this.createBlocks(); 296 if (!cont) { 297 return false; 298 } 289 299 } 290 300 301 291 302 var position = this.positionBlocks[this.relativePosition]; 292 303 for (var i = 0; i < position.blocks.length; i++) { 293 304
