[pve-devel] [PATCH manager] gui: reset cdimage selector on change

Tim Marx t.marx at proxmox.com
Wed Oct 23 10:27:16 CEST 2019


to improve UX, disabled fields shouldn't show validation errors.

Signed-off-by: Tim Marx <t.marx at proxmox.com>
---
 www/manager6/qemu/CDEdit.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/manager6/qemu/CDEdit.js b/www/manager6/qemu/CDEdit.js
index 78d758c7..a1636aa9 100644
--- a/www/manager6/qemu/CDEdit.js
+++ b/www/manager6/qemu/CDEdit.js
@@ -89,7 +89,8 @@ Ext.define('PVE.qemu.CDInputPanel', {
 		    }
 		    me.down('field[name=cdstorage]').setDisabled(!value);
 		    me.down('field[name=cdimage]').setDisabled(!value);
-		    me.down('field[name=cdimage]').validate();
+		    var cdImageField = me.down('field[name=cdimage]');
+		    value ? cdImageField.validate() : cdImageField.reset();
 		}
 	    }
 	});
--
2.20.1




More information about the pve-devel mailing list