[pve-devel] [PATCH pve-manager 2/3] do not use applyIf when adding items in initComponent()

Emmanuel Kasper e.kasper at proxmox.com
Thu Mar 3 14:43:22 CET 2016


our parent class Ext.grid.GridPanel sets 'tbar: null'
and Ext.applyIf() will only apply our property
if it is undefined, so switch to Ext.apply()

it is safe to use Ext.apply() because none of these classes is further extended,
so we don't have to worry that might me might override a toolbar
set further down by a child class

this fixes allows the panel to display its top toolbar with add/edit buttons
---
 www/manager6/lxc/DNS.js       | 2 +-
 www/manager6/lxc/Network.js   | 2 +-
 www/manager6/lxc/Options.js   | 2 +-
 www/manager6/lxc/Resources.js | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/www/manager6/lxc/DNS.js b/www/manager6/lxc/DNS.js
index 55205b4..dd5e45a 100644
--- a/www/manager6/lxc/DNS.js
+++ b/www/manager6/lxc/DNS.js
@@ -258,7 +258,7 @@ Ext.define('PVE.lxc.DNS', {
 	    edit_btn.setDisabled(!rowdef.editor);
 	};
 
-	Ext.applyIf(me, {
+	Ext.apply(me, {
 	    url: "/api2/json/nodes/" + nodename + "/lxc/" + vmid + "/config",
 	    selModel: sm,
 	    cwidth1: 150,
diff --git a/www/manager6/lxc/Network.js b/www/manager6/lxc/Network.js
index 7d152cc..211fddc 100644
--- a/www/manager6/lxc/Network.js
+++ b/www/manager6/lxc/Network.js
@@ -448,7 +448,7 @@ Ext.define('PVE.lxc.NetworkView', {
 	    handler: run_editor
 	});
 
-	Ext.applyIf(me, {
+	Ext.apply(me, {
 	    store: store,
 	    selModel: sm,
 	    stateful: false,
diff --git a/www/manager6/lxc/Options.js b/www/manager6/lxc/Options.js
index fffd8e7..4408114 100644
--- a/www/manager6/lxc/Options.js
+++ b/www/manager6/lxc/Options.js
@@ -188,7 +188,7 @@ Ext.define('PVE.lxc.Options', {
 	    handler: run_editor
 	});
 
-	Ext.applyIf(me, {
+	Ext.apply(me, {
 	    url: "/api2/json/nodes/" + nodename + "/lxc/" + vmid + "/config",
 	    selModel: sm,
 	    cwidth1: 150,
diff --git a/www/manager6/lxc/Resources.js b/www/manager6/lxc/Resources.js
index 2a0247d..ae9d358 100644
--- a/www/manager6/lxc/Resources.js
+++ b/www/manager6/lxc/Resources.js
@@ -237,7 +237,7 @@ Ext.define('PVE.lxc.RessourceView', {
 
 	};
 	
-	Ext.applyIf(me, {
+	Ext.apply(me, {
 	    url: '/api2/json/' + baseurl,
 	    selModel: sm,
 	    cwidth1: 170,
-- 
2.1.4





More information about the pve-devel mailing list