[Commits] r861 - in core/trunk/geoext: lib/GeoExt/widgets tests/lib/GeoExt/widgets

commits at geoext.org commits at geoext.org
Sat May 23 08:17:06 CEST 2009


Author: tschaub
Date: 2009-05-23 08:17:05 +0200 (Sat, 23 May 2009)
New Revision: 861

Modified:
   core/trunk/geoext/lib/GeoExt/widgets/Popup.js
   core/trunk/geoext/tests/lib/GeoExt/widgets/Popup.html
Log:
A map might be destroyed before a popup is destroyed.  r=ahocevar (closes #73)

Modified: core/trunk/geoext/lib/GeoExt/widgets/Popup.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/widgets/Popup.js	2009-05-22 23:25:25 UTC (rev 860)
+++ core/trunk/geoext/lib/GeoExt/widgets/Popup.js	2009-05-23 06:17:05 UTC (rev 861)
@@ -288,11 +288,13 @@
      *  Utility method for unbinding events that call for popup repositioning.
      */
     unbindFromMapPanel: function() {
-        //stop position with feature
-        this.map.events.un({
-            "move" : this.position,
-            scope : this
-        });
+        if(this.map && this.map.events) {
+            //stop position with feature
+            this.map.events.un({
+                "move" : this.position,
+                scope : this
+            });
+        }
 
         this.un("resize", this.position);
         this.un("collapse", this.position);

Modified: core/trunk/geoext/tests/lib/GeoExt/widgets/Popup.html
===================================================================
--- core/trunk/geoext/tests/lib/GeoExt/widgets/Popup.html	2009-05-22 23:25:25 UTC (rev 860)
+++ core/trunk/geoext/tests/lib/GeoExt/widgets/Popup.html	2009-05-23 06:17:05 UTC (rev 861)
@@ -67,7 +67,7 @@
 
             t.ok(context.mapPanel.el.child("div." + pop.popupCls),"Map panel contains popup");
             
-            //tearDown(context);
+            tearDown(context);
         }
 
         function test_anchorPopup(t) {
@@ -97,7 +97,7 @@
             action = "popup expand"
             pop.expand();
             
-            //tearDown(context);
+            tearDown(context);
         }
 
 
@@ -141,7 +141,7 @@
             action = "popup collapse";
             pop.collapse();
             
-            //tearDown(context);
+            tearDown(context);
 
         }
 
@@ -171,7 +171,7 @@
             action = "popup collapse";
             pop.collapse();
             
-            //tearDown(context);
+            tearDown(context);
         }
 
     </script>



More information about the Commits mailing list