]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
form: integer field: code cleanup in getSubmitData
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 7 Nov 2022 13:56:49 +0000 (14:56 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 7 Nov 2022 13:56:49 +0000 (14:56 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/form/IntegerField.js

index 67dd215f60d3f5e9b6e71c84fddb275e33bcd40f..48a2e888343ff48cb4bdb4bdde86ed746244c6a1 100644 (file)
@@ -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;
     },
 
 });