[pve-devel] r6232 - pve-manager/pve2/www/manager/qemu

svn-commits at proxmox.com svn-commits at proxmox.com
Tue Jul 5 09:09:35 CEST 2011


Author: dietmar
Date: 2011-07-05 09:09:35 +0200 (Tue, 05 Jul 2011)
New Revision: 6232

Modified:
   pve-manager/pve2/www/manager/qemu/HardwareView.js
Log:
simplify code


Modified: pve-manager/pve2/www/manager/qemu/HardwareView.js
===================================================================
--- pve-manager/pve2/www/manager/qemu/HardwareView.js	2011-07-05 06:53:25 UTC (rev 6231)
+++ pve-manager/pve2/www/manager/qemu/HardwareView.js	2011-07-05 07:09:35 UTC (rev 6232)
@@ -4,14 +4,11 @@
     submit: function(formpanel) {
 	var me = this;
 
-	var field = me.down('field[name=cache]');
-	var value = field.getValue();
-	me.drive.cache = value ? value : undefined;
-	
-	field = me.down('field[name=nobackup]');
-	value = field.getValue();
-	me.drive.backup = value ? 'no' : undefined;
+	var values = formpanel.getValues();
 
+	me.drive.cache = values.cache ? values.cache : undefined;	
+	me.drive.backup = values.nobackup ? 'no' : undefined;
+
 	var params = {};
 
 	params[me.confid] = PVE.Parser.printQemuDrive(me.drive);




More information about the pve-devel mailing list