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.
This commit is contained in:
Emmanuel Kasper 2015-07-29 14:13:57 +02:00 committed by Dietmar Maurer
parent 6d4e7e14d2
commit 398459d1e9

View File

@ -232,13 +232,17 @@ Ext.define('PVE.window.Edit', {
me.title = PVE.Utils.dialog_title(me.subject, me.create, me.isAdd); 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, { Ext.applyIf(me, {
modal: true, modal: true,
layout: 'auto',
width: twoColumn ? colwidth*2 : colwidth, width: twoColumn ? colwidth*2 : colwidth,
border: false, border: false,
items: [ me.formPanel ], items: [ me.formPanel ],
buttons: me.create ? [ submitBtn ] : [ submitBtn, resetBtn ]
}); });
me.callParent(); me.callParent();