]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
TimeEdit: use schematic declaration
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 16 Jan 2018 13:20:48 +0000 (14:20 +0100)
committerDominik Csapak <d.csapak@proxmox.com>
Wed, 17 Jan 2018 11:21:04 +0000 (12:21 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
node/TimeEdit.js

index 605210d21e56d40491686e1583c20eb5f68d3b8a..2e318b202e54333d36618bfa892217a6357da70d 100644 (file)
@@ -2,37 +2,36 @@ Ext.define('Proxmox.node.TimeEdit', {
     extend: 'Proxmox.window.Edit',
     alias: ['widget.proxmoxNodeTimeEdit'],
 
+    subject: gettext('Time zone'),
+
+    width: 400,
+
+    autoLoad: true,
+
+    fieldDefaults: {
+       labelWidth: 70
+    },
+
+    items: {
+       xtype: 'combo',
+       fieldLabel: gettext('Time zone'),
+       name: 'timezone',
+       queryMode: 'local',
+       store: Ext.create('Proxmox.data.TimezoneStore'),
+       displayField: 'zone',
+       forceSelection: true,
+       editable: false,
+       allowBlank: false
+    },
+
     initComponent : function() {
        var me = this;
 
        if (!me.nodename) {
            throw "no node name specified";
        }
-
-       Ext.applyIf(me, {
-           subject: gettext('Time zone'),
-           url: "/api2/extjs/nodes/" + me.nodename + "/time",
-           fieldDefaults: {
-               labelWidth: 70
-            },
-           width: 400,
-           items: {
-               xtype: 'combo',
-               fieldLabel: gettext('Time zone'),
-               name: 'timezone',
-               queryMode: 'local',
-               store: Ext.create('Proxmox.data.TimezoneStore'),
-               valueField: 'zone',
-               displayField: 'zone',
-               triggerAction: 'all',
-               forceSelection: true,
-               editable: false,
-               allowBlank: false
-           }
-       });
+       me.url = "/api2/extjs/nodes/" + me.nodename + "/time";
 
        me.callParent();
-
-       me.load();
     }
 });