[Commits] r1674 - sandbox/redlining/ux/RedLining/ux/widgets

commits at geoext.org commits at geoext.org
Fri Jan 8 16:21:47 CET 2010


Author: adube
Date: 2010-01-08 16:21:47 +0100 (Fri, 08 Jan 2010)
New Revision: 1674

Modified:
   sandbox/redlining/ux/RedLining/ux/widgets/MainControler.js
Log:
GeoExt.Popup added, currently blank

Modified: sandbox/redlining/ux/RedLining/ux/widgets/MainControler.js
===================================================================
--- sandbox/redlining/ux/RedLining/ux/widgets/MainControler.js	2010-01-08 14:58:04 UTC (rev 1673)
+++ sandbox/redlining/ux/RedLining/ux/widgets/MainControler.js	2010-01-08 15:21:47 UTC (rev 1674)
@@ -65,7 +65,7 @@
             scope: this
         });
         layer.events.on({
-           "afterfeaturemodified": this.resumeDraw,
+           "featureunselected": this.onFeatureUnselect,
             scope: this
         });
     },
@@ -258,29 +258,42 @@
         */
 
         // display the popup
+        var popup = new GeoExt.Popup({
+            feature: feature,
+            width: 200,
+            title: 'EditFeature',
+            main: this
+        });
+        feature.popup = popup;
+        popup.on({
+            close: function() {
+                if(OpenLayers.Util.indexOf(this.main.activeLayer.selectedFeatures,
+                                           this.feature) > -1) {
+                    this.main.getSelectControl().unselect(this.feature);
+                }
+            }
+        });
+        popup.show();
+
     },
 
     onModification: function(object) {
         //we could execute commits here
     },
 
-    /**
-     * Method: onModificationEnd
-     * Called after feature modification.  
-     * If using a FeaturePanel :
-     *     Validate that it's currently commiting.  If not, depending of the
-     *     feature state, reset or destroy the feature.
-     * If not using a FeaturePanel :
-     *     Simply commit the modifications made to the feature.
-     *
-     * Parameters:
-     * object - {<OpenLayers.Event>} Used to get the modified feature
-     */
     onModificationEnd: function(object) {
         var feature = (object.geometry) ? object : object.feature;
 
         // or we could execute commits here also
     },
 
+    onFeatureUnselect: function(object) {
+        var feature = (object.geometry) ? object : object.feature;
+
+        if(feature.popup){
+            feature.popup.close();
+        }
+    },
+
     CLASS_NAME: "GeoExt.ux.MainControler"
 });



More information about the Commits mailing list