[pve-devel] [PATCH manager v2 1/4] Add a new property afterTaskProgress to Edit Window

Emmanuel Kasper e.kasper at proxmox.com
Thu Dec 22 12:15:20 CET 2016


The main aim of this new parameter is to allow
a refresh of a GridPanel *after* the task window
has been closed, and not after Edit Window is closed
which is often two early.
---
 www/manager6/window/Edit.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/www/manager6/window/Edit.js b/www/manager6/window/Edit.js
index 0f9c611..36ef7b6 100644
--- a/www/manager6/window/Edit.js
+++ b/www/manager6/window/Edit.js
@@ -24,6 +24,10 @@ Ext.define('PVE.window.Edit', {
 
     showProgress: false,
 
+    // if background or showProcess are set,
+    // set an optional hook to be executed when the TaskProcess window closes
+    afterTaskProgress: undefined,
+
     isValid: function() {
 	var me = this;
 
@@ -118,6 +122,9 @@ Ext.define('PVE.window.Edit', {
 		    var win = Ext.create('PVE.window.TaskProgress', { 
 			upid: upid
 		    });
+		    if (Ext.isFunction(me.afterTaskProgress)) {
+			win.on('destroy', me.afterTaskProgress);
+		    }
 		    win.show();
 		}
 	    }
-- 
2.1.4





More information about the pve-devel mailing list