diff app/view/orte/CreateForm.js @ 491:850ccfe5f3c4

Code style.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 31 Oct 2014 23:23:32 +0100
parents 446e99cfd425
children d07e5086a64b
line wrap: on
line diff
--- a/app/view/orte/CreateForm.js	Fri Oct 31 21:28:31 2014 +0100
+++ b/app/view/orte/CreateForm.js	Fri Oct 31 23:23:32 2014 +0100
@@ -20,112 +20,106 @@
     ],
     edit: false,
     initComponent: function() {
-        this.items = [
-            {
-                xtype: 'ortdetail',
-                name: 'ortId',
-                fieldLabel: 'Ort',
-                listeners: {
-                    scope: this,
-                    'change': function (field, newv, oldv, opts) {
-                        if (field.up('window')) {
-                            field.up('window').down('fieldset').show();
-                        }
-                        var orte = Ext.getStore('StaOrte');
-                        var ort = orte.getById(newv);
-                        var fields = ['beschreibung', 'bezeichnung', 'hoeheLand',
-                                      'latitude', 'longitude', 'staatId', 'gemId'];
+        this.items = [{
+            xtype: 'ortdetail',
+            name: 'ortId',
+            fieldLabel: 'Ort',
+            listeners: {
+                scope: this,
+                'change': function (field, newv, oldv, opts) {
+                    if (field.up('window')) {
+                        field.up('window').down('fieldset').show();
+                    }
+                    var orte = Ext.getStore('StaOrte');
+                    var ort = orte.getById(newv);
+                    var fields = [
+                        'beschreibung',
+                        'bezeichnung',
+                        'hoeheLand',
+                        'latitude',
+                        'longitude',
+                        'staatId',
+                        'gemId'
+                    ];
 
-                        // Load currently "selected" verwaltungseinheit.  This
-                        // is needed as without having this record the field
-                        // would only display the raw value (id) of the
-                        // verwaltungseinheit.
-                        var verw = Ext.getStore('StaVerwaltungseinheiten');
-                        if (ort) {
-                            verw.load({
-                                id: ort.get('gemId')
-                            });
-                        }
+                    // Load currently "selected" verwaltungseinheit.  This
+                    // is needed as without having this record the field
+                    // would only display the raw value (id) of the
+                    // verwaltungseinheit.
+                    var verw = Ext.getStore('StaVerwaltungseinheiten');
+                    if (ort) {
+                        verw.load({
+                            id: ort.get('gemId')
+                        });
+                    }
 
-                        var form = this.getForm();
-                        if ( ort != undefined ) {
-                            for (var i = fields.length - 1; i >= 0; i--){
-                                ffield = form.findField("ort_"+fields[i]);
-                                ffield.setValue(ort.get(fields[i]));
-                            }
+                    var form = this.getForm();
+                    if ( ort != undefined ) {
+                        for (var i = fields.length - 1; i >= 0; i--){
+                            ffield = form.findField("ort_"+fields[i]);
+                            ffield.setValue(ort.get(fields[i]));
                         }
                     }
                 }
-            },
-            {
-                xtype: 'textfield',
-                name: 'ortsTyp',
-                maxLength: 1,
-                fieldLabel: 'Typ'
-            },
-            {
-                xtype: 'textareafield',
-                name: 'ortszusatztext',
-                maxLength: 100,
-                fieldLabel: 'Ortszusatz'
-            },
-            {
-                xtype: 'button',
-                name: 'newort',
-                text: 'Neuen Ort Anlegen',
-                hidden: this.edit,
-                action: 'newort'
+            }
+        }, {
+            xtype: 'textfield',
+            name: 'ortsTyp',
+            maxLength: 1,
+            fieldLabel: 'Typ'
+        }, {
+            xtype: 'textareafield',
+            name: 'ortszusatztext',
+            maxLength: 100,
+            fieldLabel: 'Ortszusatz'
+        }, {
+            xtype: 'button',
+            name: 'newort',
+            text: 'Neuen Ort Anlegen',
+            hidden: this.edit,
+            action: 'newort'
+        }, {
+            xtype: 'fieldset',
+            title: 'Ortsangaben',
+            hidden: !this.edit,
+            defaults: {
+                    labelWidth: 150
             },
-            {
-                xtype: 'fieldset',
-                title: 'Ortsangaben',
-                hidden: !this.edit,
-                defaults: {
-                        labelWidth: 150
-                },
-                items: [
-                    {
-                        xtype: 'textfield',
-                        maxLength: 100,
-                        name: 'ort_beschreibung',
-                        fieldLabel: 'Beschreibung'
-                    },
-                    {
-                        xtype: 'textfield',
-                        maxLength: 10,
-                        name: 'ort_bezeichnung',
-                        fieldLabel: 'Bezeichnung'
-                    },
-                    {
-                        xtype: 'staat',
-                        name: 'ort_staatId',
-                        fieldLabel: 'Staat'
-                    },
-                    {
-                        xtype: 'verwaltungseinheiten',
-                        name: 'ort_gemId',
-                        fieldLabel: 'Gemeinde'
-                    },
-                    {
-                        xtype: 'numberfield',
-                        name: 'ort_latitude',
-                        fieldLabel: 'Lat'
-                    },
-                    {
-                        xtype: 'numberfield',
-                        name: 'ort_longitude',
-                        fieldLabel: 'Lon'
-                    },
-                    {
-                        xtype: 'numberfield',
-                        name: 'ort_hoeheLand',
-                        fieldLabel: 'Höhe'
-                    }
-                ]
-            }
-        ];
-        this.callParent();
+            items: [{
+                xtype: 'textfield',
+                maxLength: 100,
+                name: 'ort_beschreibung',
+                fieldLabel: 'Beschreibung'
+            }, {
+                xtype: 'textfield',
+                maxLength: 10,
+                name: 'ort_bezeichnung',
+                fieldLabel: 'Bezeichnung'
+            }, {
+                xtype: 'staat',
+                name: 'ort_staatId',
+                fieldLabel: 'Staat'
+            }, {
+                xtype: 'verwaltungseinheiten',
+                name: 'ort_gemId',
+                fieldLabel: 'Gemeinde'
+            }, {
+                xtype: 'numberfield',
+                name: 'ort_latitude',
+                fieldLabel: 'Lat'
+            }, {
+                xtype: 'numberfield',
+                name: 'ort_longitude',
+                fieldLabel: 'Lon'
+            }, {
+                xtype: 'numberfield',
+                name: 'ort_hoeheLand',
+                fieldLabel: 'Höhe'
+            }]
+        }];
+        this.callParent(arguments);
     },
+
     updateOrtInfo: function(field, oldv, newv, opts) {
         console.log(field, oldv, newv, opts);
     }

http://lada.wald.intevation.org