[pve-devel] [PATCH 2/2] TimeEdit: use schematic declaration

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Jan 16 14:20:48 CET 2018


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 node/TimeEdit.js | 47 +++++++++++++++++++++++------------------------
 1 file changed, 23 insertions(+), 24 deletions(-)

diff --git a/node/TimeEdit.js b/node/TimeEdit.js
index 605210d..2e318b2 100644
--- a/node/TimeEdit.js
+++ b/node/TimeEdit.js
@@ -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();
     }
 });
-- 
2.11.0





More information about the pve-devel mailing list