From 398459d1e9878e0970a8ea31d5a60c8d9130d824 Mon Sep 17 00:00:00 2001 From: Emmanuel Kasper Date: Wed, 29 Jul 2015 14:13:57 +0200 Subject: [PATCH] ext5migrate: set buttons property directly instead of calling applyIf 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 3e69da9c..e150cf1d 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();