[pve-devel] [PATCH v2 3/3] Declare data object in one statement when we want to delete a parameter

Dietmar Maurer dietmar at proxmox.com
Tue Aug 18 16:42:33 CEST 2015



On 08/18/2015 10:36 AM, Emmanuel Kasper wrote:
> Also add missing formatting
> ---
>   www/manager5/form/KVComboBox.js | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/www/manager5/form/KVComboBox.js b/www/manager5/form/KVComboBox.js
> index 77bf8f4..8b66dfc 100644
> --- a/www/manager5/form/KVComboBox.js
> +++ b/www/manager5/form/KVComboBox.js
> @@ -7,7 +7,7 @@ Ext.define('PVE.form.KVComboBox', {
>       extend: 'Ext.form.field.ComboBox',
>       alias: 'widget.pveKVComboBox',
>   
> -    deleteEmpty: true,
> +    deleteWhenEmpty: true,
why do you rename? Why don't you use a config property?

config: {
  deleteEmpty: true,
  comboItems: undefined
},


>       config: {
>           comboItems: undefined
>       },
> @@ -21,10 +21,9 @@ Ext.define('PVE.form.KVComboBox', {
>               if (val !== null && val !== '') {
>                   data = {};
>                   data[me.getName()] = val;
> -            } else if (me.deleteEmpty) {
> -		data = {};
> -                data['delete'] = me.getName();
> -	    }
> +            } else if (me.deleteWhenEmpty) {
> +				data = {'delete': me.getName()};
> +	    	}
>           }
>           return data;
>       },





More information about the pve-devel mailing list