[Commits] r1807 - in sandbox/redlining/ux/FeatureEditing/ux: . widgets widgets/plugins
commits at geoext.org
commits at geoext.org
Sun Jan 24 06:40:58 CET 2010
Author: cmoullet
Date: 2010-01-24 06:40:58 +0100 (Sun, 24 Jan 2010)
New Revision: 1807
Added:
sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/CloseFeatureDialog.js
Modified:
sandbox/redlining/ux/FeatureEditing/ux/FeatureEditing.js
sandbox/redlining/ux/FeatureEditing/ux/widgets/FeatureEditingControler.js
Log:
Add close feature button
Modified: sandbox/redlining/ux/FeatureEditing/ux/FeatureEditing.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/FeatureEditing.js 2010-01-23 09:27:59 UTC (rev 1806)
+++ sandbox/redlining/ux/FeatureEditing/ux/FeatureEditing.js 2010-01-24 05:40:58 UTC (rev 1807)
@@ -59,7 +59,8 @@
"widgets/plugins/ImportFeatures.js",
"widgets/plugins/ExportFeatures.js",
- "widgets/plugins/ExportFeature.js"
+ "widgets/plugins/ExportFeature.js",
+ "widgets/plugins/CloseFeatureDialog.js"
);
var agent = navigator.userAgent;
Modified: sandbox/redlining/ux/FeatureEditing/ux/widgets/FeatureEditingControler.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/widgets/FeatureEditingControler.js 2010-01-23 09:27:59 UTC (rev 1806)
+++ sandbox/redlining/ux/FeatureEditing/ux/widgets/FeatureEditingControler.js 2010-01-24 05:40:58 UTC (rev 1807)
@@ -435,7 +435,7 @@
// if the user clicked on an other feature while adding a new one,
// deactivate the draw control.
- drawControl = this.getActiveDrawControl();
+ var drawControl = this.getActiveDrawControl();
if (drawControl) {
drawControl.deactivate();
this.featureControl.activate();
@@ -446,7 +446,7 @@
features: [feature],
controler: this,
useIcons: this.useIcons,
- plugins: [new GeoExt.ux.ExportFeature()]
+ plugins: [new GeoExt.ux.ExportFeature(), new GeoExt.ux.CloseFeatureDialog()]
};
this.featurePanel = new GeoExt.ux.form.FeaturePanel(options);
Added: sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/CloseFeatureDialog.js
===================================================================
--- sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/CloseFeatureDialog.js (rev 0)
+++ sandbox/redlining/ux/FeatureEditing/ux/widgets/plugins/CloseFeatureDialog.js 2010-01-24 05:40:58 UTC (rev 1807)
@@ -0,0 +1,36 @@
+GeoExt.ux.CloseFeatureDialog = Ext.extend(Ext.util.Observable, {
+
+ controler: null,
+
+ editFeatureForm: null,
+
+ init: function(form) {
+ this.controler = form.controler;
+
+ var actionOptions = {
+ handler: this.closeFeatureDialog,
+ scope: this,
+ tooltip: OpenLayers.i18n('Close')
+ };
+
+ actionOptions.text = OpenLayers.i18n("Close");
+
+ var action = new Ext.Action(actionOptions);
+
+ var bbar = form.getBottomToolbar();
+ if (bbar.rendered || !bbar.buttons) {
+ bbar.add('->');
+ bbar.add(action);
+ } else {
+ bbar.buttons.push('->');
+ bbar.buttons.push(action);
+ }
+
+ this.editFeatureForm = form;
+ },
+
+ closeFeatureDialog: function() {
+ this.controler.triggerAutoSave();
+ this.controler.popup.close();
+ }
+});
\ No newline at end of file
More information about the Commits
mailing list