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

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Jul 6 13:13:58 CEST 2011


Author: dietmar
Date: 2011-07-06 13:13:58 +0200 (Wed, 06 Jul 2011)
New Revision: 6247

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


Modified: pve-manager/pve2/www/manager/qemu/HardwareView.js
===================================================================
--- pve-manager/pve2/www/manager/qemu/HardwareView.js	2011-07-06 11:00:20 UTC (rev 6246)
+++ pve-manager/pve2/www/manager/qemu/HardwareView.js	2011-07-06 11:13:58 UTC (rev 6247)
@@ -313,19 +313,13 @@
 		    return;
 		}
 
-		var field = me.down('field[name=file]');
-		field.setValue(me.drive.file);
-		field.resetOriginalValue();
+		var values = {};
 
-		field = me.down('field[name=cache]');
-		field.setValue(me.drive.cache || '');
-		field.resetOriginalValue();
+		values.file = me.drive.file;
+		values.cache = me.drive.cache || '';
+		values.nobackup = (me.drive.backup === 'no');
 
-		if (me.drive.backup === 'no') {
-		    field = me.down('field[name=nobackup]');
-		    field.setValue(true);
-		    field.resetOriginalValue();
-		}
+		form.setValues(values);
 	    }
 	});
     }




More information about the pve-devel mailing list