proxmox-widget-toolkit/form/IntegerField.js
Thomas Lamprecht 05a977a227 make eslint 100% happy
lots of churn and changes but will allow to enforce linting again in
the build system.

Also switch over from var to let.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 17:16:22 +02:00

31 lines
726 B
JavaScript

Ext.define('Proxmox.form.field.Integer', {
extend: 'Ext.form.field.Number',
alias: 'widget.proxmoxintegerfield',
config: {
deleteEmpty: false,
},
allowDecimals: false,
allowExponential: false,
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()) {
data = {};
data.delete = me.getName();
}
}
return data;
},
});