[pve-devel] [PATCH manager] Minor refactor for #1115 (reload grid after template download)

Emmanuel Kasper e.kasper at proxmox.com
Wed Sep 28 10:51:57 CEST 2016


Move the listener to the new window declaration to make it clear
this listener is not bound to the current component
---
 www/manager6/storage/ContentView.js | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/www/manager6/storage/ContentView.js b/www/manager6/storage/ContentView.js
index 14d65ca..4253b60 100644
--- a/www/manager6/storage/ContentView.js
+++ b/www/manager6/storage/ContentView.js
@@ -123,11 +123,13 @@ Ext.define('PVE.storage.TemplateDownload', {
 		    success: function(response, options) {
 			var upid = response.result.data;
 
-			var win = Ext.create('PVE.window.TaskViewer', {
-			    upid: upid
-			});
-			win.show();
-			win.on('destroy', me.reloadGrid);
+			Ext.create('PVE.window.TaskViewer', {
+			    upid: upid,
+			    listeners: {
+				destroy: me.reloadGrid
+			    }
+			}).show();
+
 			me.close();
 		    }
 		});
-- 
2.1.4





More information about the pve-devel mailing list