[pmg-devel] [PATCH pmg-gui 3/4] MainView: use new beforeChangePath signature

Dominik Csapak d.csapak at proxmox.com
Wed May 26 11:13:11 CEST 2021


subpath can be optional in extjs 7.0, so handle that

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 js/MainView.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/js/MainView.js b/js/MainView.js
index 9ebd065..0382d1f 100644
--- a/js/MainView.js
+++ b/js/MainView.js
@@ -17,9 +17,15 @@ Ext.define('PMG.MainView', {
 	    },
 	},
 
-	beforeChangePath: function(path, subpath, action) {
+	beforeChangePath: function(path, subpathOrAction, action) {
 	    let me = this;
 
+	    let subpath = subpathOrAction;
+	    if (!action) {
+		action = subpathOrAction;
+		subpath = undefined;
+	    }
+
 	    if (!Ext.ClassManager.getByAlias('widget.'+ path)) {
 		console.warn('xtype "'+path+'" not found');
 		action.stop();
-- 
2.20.1





More information about the pmg-devel mailing list