[pve-devel] [PATCH] ext5migrate: set buttons property directly instead of calling applyIf

Emmanuel Kasper e.kasper at proxmox.com
Wed Jul 29 14:13:57 CEST 2015


It seems that in ExtJS5 the prototype of the Window component already sets
some default values to me.buttons and me.layout, hence calling applyIf
on these properties will silently fail.

me.layout is already set to 'auto' by the framework, we don't need to set
that anymore.
---
 www/manager5/window/Edit.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/www/manager5/window/Edit.js b/www/manager5/window/Edit.js
index 3e69da9..e150cf1 100644
--- a/www/manager5/window/Edit.js
+++ b/www/manager5/window/Edit.js
@@ -232,13 +232,17 @@ Ext.define('PVE.window.Edit', {
 	    me.title = PVE.Utils.dialog_title(me.subject, me.create, me.isAdd);
 	}
 
+	if (me.create) {
+		me.buttons = [ submitBtn ] ;
+	} else {
+		me.buttons = [ submitBtn, resetBtn ];
+	}
+
 	Ext.applyIf(me, {
 	    modal: true,
-	    layout: 'auto',
 	    width: twoColumn ? colwidth*2 : colwidth,
 	    border: false,
 	    items: [ me.formPanel ],
-	    buttons: me.create ? [ submitBtn ] : [ submitBtn, resetBtn ]
 	});
 
 	me.callParent();
-- 
2.1.4





More information about the pve-devel mailing list