proxmox-widget-toolkit/src/form/PruneKeepField.js
Thomas Lamprecht 9b4b2e745b form: add PruneKeepField
over from PBS

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-11-21 20:02:45 +01:00

28 lines
547 B
JavaScript

Ext.define('Proxmox.form.PruneKeepField', {
extend: 'Proxmox.form.field.Integer',
xtype: 'pmxPruneKeepField',
allowBlank: true,
minValue: 1,
listeners: {
change: function(field, newValue, oldValue) {
if (newValue !== this.originalValue) {
this.triggers.clear.setVisible(true);
}
},
},
triggers: {
clear: {
cls: 'pmx-clear-trigger',
weight: -1,
hidden: true,
handler: function() {
this.triggers.clear.setVisible(false);
this.setValue(this.originalValue);
},
},
},
});