proxmox-widget-toolkit/form/IntegerField.js
Thomas Lamprecht 01031528ad eslint fixes all over the place
all autofixed by eslint with a slightly reduced base config rule set
to avoid rules which may give some undesired results in our code
base.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-06-06 15:02:29 +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() {
var 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;
},
});