From: Thomas Lamprecht Date: Mon, 7 Nov 2022 13:56:49 +0000 (+0100) Subject: form: integer field: code cleanup in getSubmitData X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=8df4bd63d7354be3a36216b63db2e290dd493b68;p=proxmox-widget-toolkit.git form: integer field: code cleanup in getSubmitData Signed-off-by: Thomas Lamprecht --- diff --git a/src/form/IntegerField.js b/src/form/IntegerField.js index 67dd215..48a2e88 100644 --- a/src/form/IntegerField.js +++ b/src/form/IntegerField.js @@ -11,20 +11,19 @@ Ext.define('Proxmox.form.field.Integer', { step: 1, getSubmitData: function() { - let me = this, - data = null, - val; - if (!me.disabled && me.submitValue && !me.isFileUpload()) { - val = me.getSubmitValue(); - if (val !== undefined && val !== null && val !== '') { - data = {}; - data[me.getName()] = val; - } else if (me.getDeleteEmpty()) { + let me = this; + let data = null; + if (!me.disabled && me.submitValue && !me.isFileUpload()) { + let val = me.getSubmitValue(); + if (val !== undefined && val !== null && val !== '') { data = {}; - data.delete = me.getName(); + data[me.getName()] = val; + } else if (me.getDeleteEmpty()) { + data = {}; + data.delete = me.getName(); } - } - return data; + } + return data; }, });