pve-manager/www/manager6/controller/StorageEdit.js
Emmanuel Kasper a7664d88d6 Add Storage Controller class
This controller will display the 'Max Backups' field only if the storage can
hold backups.

Signed-off-by: Emmanuel Kasper <e.kasper@proxmox.com>
2017-11-07 09:35:45 +01:00

19 lines
459 B
JavaScript

Ext.define('PVE.controller.StorageEdit', {
extend: 'Ext.app.ViewController',
alias: 'controller.storageEdit',
control: {
'field[name=content]': {
change: function(field, value) {
var hasBackups = Ext.Array.contains(value, 'backup');
var maxfiles = this.lookupReference('maxfiles');
if (!hasBackups) {
// clear values which will never be submitted
maxfiles.reset();
}
maxfiles.setDisabled(!hasBackups);
}
}
}
});