Ticket #73: 73.patch

File 73.patch, 1.8 kB (added by tschaub, 1 year ago)

consider that map might already be destroyed

  • tests/lib/GeoExt/widgets/Popup.html

    old new  
    6767 
    6868            t.ok(context.mapPanel.el.child("div." + pop.popupCls),"Map panel contains popup"); 
    6969             
    70             //tearDown(context); 
     70            tearDown(context); 
    7171        } 
    7272 
    7373        function test_anchorPopup(t) { 
     
    9797            action = "popup expand" 
    9898            pop.expand(); 
    9999             
    100             //tearDown(context); 
     100            tearDown(context); 
    101101        } 
    102102 
    103103 
     
    141141            action = "popup collapse"; 
    142142            pop.collapse(); 
    143143             
    144             //tearDown(context); 
     144            tearDown(context); 
    145145 
    146146        } 
    147147 
     
    171171            action = "popup collapse"; 
    172172            pop.collapse(); 
    173173             
    174             //tearDown(context); 
     174            tearDown(context); 
    175175        } 
    176176 
    177177    </script> 
  • lib/GeoExt/widgets/Popup.js

    old new  
    288288     *  Utility method for unbinding events that call for popup repositioning. 
    289289     */ 
    290290    unbindFromMapPanel: function() { 
    291         //stop position with feature 
    292         this.map.events.un({ 
    293             "move" : this.position, 
    294             scope : this 
    295         }); 
     291        if(this.map && this.map.events) { 
     292            //stop position with feature 
     293            this.map.events.un({ 
     294                "move" : this.position, 
     295                scope : this 
     296            }); 
     297        } 
    296298 
    297299        this.un("resize", this.position); 
    298300        this.un("collapse", this.position);