Move removeButton in a variable

The move is necessary to hide the removeButton.
This commit is contained in:
Wolfgang Link 2018-11-21 17:05:38 +01:00 committed by Thomas Lamprecht
parent 5cdb27225f
commit c5e224fc73

View File

@ -401,6 +401,20 @@ Ext.define('PVE.storage.ContentView', {
} }
}); });
var removeButton = Ext.create('Proxmox.button.StdRemoveButton',{
selModel: sm,
enableFn: function(rec) {
if (rec && rec.data.content !== 'images') {
return true;
}
return false;
},
callback: function() {
reload();
},
baseurl: baseurl + '/'
});
me.statusStore = Ext.create('Proxmox.data.ObjectStore', { me.statusStore = Ext.create('Proxmox.data.ObjectStore', {
url: '/api2/json/nodes/' + nodename + '/storage/' + storage + '/status' url: '/api2/json/nodes/' + nodename + '/storage/' + storage + '/status'
}); });
@ -437,17 +451,7 @@ Ext.define('PVE.storage.ContentView', {
win.on('destroy', reload); win.on('destroy', reload);
} }
}, },
{ removeButton,
xtype: 'proxmoxStdRemoveButton',
selModel: sm,
enableFn: function(rec) {
return rec && rec.data.content !== 'images';
},
callback: function() {
reload();
},
baseurl: baseurl + '/'
},
templateButton, templateButton,
uploadButton, uploadButton,
{ {