[pve-devel] [manager 5/6] Move removeButton in a variable

Wolfgang Link w.link at proxmox.com
Wed Nov 21 17:05:38 CET 2018


The move is necessary to hide the removeButton.
---
 www/manager6/storage/ContentView.js | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/www/manager6/storage/ContentView.js b/www/manager6/storage/ContentView.js
index 0661065d..8716fba3 100644
--- a/www/manager6/storage/ContentView.js
+++ b/www/manager6/storage/ContentView.js
@@ -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', {
 	    url: '/api2/json/nodes/' + nodename + '/storage/' + storage + '/status'
 	});
@@ -437,17 +451,7 @@ Ext.define('PVE.storage.ContentView', {
 			win.on('destroy', reload);
 		    }
 		},
-		{
-		    xtype: 'proxmoxStdRemoveButton',
-		    selModel: sm,
-		    enableFn: function(rec) {
-			return rec && rec.data.content !== 'images';
-		    },
-		    callback: function() {
-			reload();
-		    },
-		    baseurl: baseurl + '/'
-		},
+		removeButton,
 		templateButton,
 		uploadButton,
 		{
-- 
2.11.0





More information about the pve-devel mailing list