[pve-devel] [PATCH manager] disable rules copy button if not 'in' or 'out' rule

Dominik Csapak d.csapak at proxmox.com
Thu Oct 6 14:55:57 CEST 2016


else you could always click the button, but
nothing would happen

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/grid/FirewallRules.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/www/manager6/grid/FirewallRules.js b/www/manager6/grid/FirewallRules.js
index 4d151e7..aa536e2 100644
--- a/www/manager6/grid/FirewallRules.js
+++ b/www/manager6/grid/FirewallRules.js
@@ -578,6 +578,9 @@ Ext.define('PVE.FirewallRules', {
 	me.copyBtn = Ext.create('PVE.button.Button',{
 	    text: gettext('Copy'),
 	    selModel: sm,
+	    enableFn: function(rec) {
+		return (rec.data.type === 'in' || rec.data.type === 'out');
+	    },
 	    disabled: true,
 	    handler: run_copy_editor,
 	});
-- 
2.1.4





More information about the pve-devel mailing list