[pve-devel] [PATCH manager v2 20/29] TimeEdit: use schematic declaration

Thomas Lamprecht t.lamprecht at proxmox.com
Tue Dec 19 08:55:12 CET 2017


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

diff --git a/www/manager6/node/TimeEdit.js b/www/manager6/node/TimeEdit.js
index e2d884d5..f05dc16e 100644
--- a/www/manager6/node/TimeEdit.js
+++ b/www/manager6/node/TimeEdit.js
@@ -2,6 +2,28 @@ Ext.define('PVE.node.TimeEdit', {
     extend: 'Proxmox.window.Edit',
     alias: ['widget.pveNodeTimeEdit'],
 
+    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;
 
@@ -9,31 +31,8 @@ Ext.define('PVE.node.TimeEdit', {
 	if (!nodename) {
 	    throw "no node name specified";
 	}
-
-	Ext.applyIf(me, {
-	    subject: gettext('Time zone'),
-	    url: "/api2/extjs/nodes/" + 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/" + nodename + "/time";
 
 	me.callParent();
-
-	me.load();
     }
 });
-- 
2.11.0





More information about the pve-devel mailing list