From 1fafdce8c2bef65f68368c897ff0d5945f1c7ea5 Mon Sep 17 00:00:00 2001 From: Emmanuel Kasper Date: Mon, 15 Feb 2016 09:23:00 +0100 Subject: [PATCH] ext6migrate: fix display of sport/dport/proto combo boxes setting the field value of to '' would trigger the 'change' event which would then disable the sport/dport/proto comboboxes too early, an empty form would have the comboboxes disabled too instead keep the field to a null value if it is empty, but force it to '' before sending to the pve-proxy also makes the macro selector keyboard editable, similar to the other comboboxes in the input panel --- www/manager6/grid/FirewallRules.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/manager6/grid/FirewallRules.js b/www/manager6/grid/FirewallRules.js index 371fc415..f03ceb96 100644 --- a/www/manager6/grid/FirewallRules.js +++ b/www/manager6/grid/FirewallRules.js @@ -58,7 +58,7 @@ Ext.define('PVE.FirewallRulePanel', { // hack: editable ComboGrid returns nothing when empty, so we need to set '' // Also, disabled text fields return nothing, so we need to set '' - Ext.Array.each(['source', 'dest', 'proto', 'sport', 'dport'], function(key) { + Ext.Array.each(['source', 'dest', 'macro', 'proto', 'sport', 'dport'], function(key) { if (values[key] === undefined) { values[key] = ''; } @@ -161,12 +161,12 @@ Ext.define('PVE.FirewallRulePanel', { { xtype: 'pveFWMacroSelector', name: 'macro', - value: '', fieldLabel: gettext('Macro'), + editable: true, allowBlank: true, listeners: { change: function(f, value) { - if (value === '') { + if (value === null) { me.down('field[name=proto]').setDisabled(false); me.down('field[name=sport]').setDisabled(false); me.down('field[name=dport]').setDisabled(false);