In preparation to add a 'value' argument, because when the controller calls the function, the panel is passed as the first argument.
And for convenience when calling from outside the class. Signed-off-by: Fabian Ebner <[email protected]> --- www/manager6/qemu/MemoryEdit.js | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/www/manager6/qemu/MemoryEdit.js b/www/manager6/qemu/MemoryEdit.js index 5e91dc9b..0d2cd8b0 100644 --- a/www/manager6/qemu/MemoryEdit.js +++ b/www/manager6/qemu/MemoryEdit.js @@ -17,20 +17,25 @@ Ext.define('PVE.qemu.MemoryInputPanel', { }, setMemory: function() { - let me = this; - let view = me.getView(), viewModel = me.getViewModel(); - if (view.insideWizard) { - let memory = view.down('pveMemoryField[name=memory]'); - // NOTE: we only set memory but that then sets balloon in its change handler - if (viewModel.get('current.ostype') === 'win11') { - memory.setValue('4096'); - } else { - memory.setValue('2048'); - } - } + this.getView().setMemory(); }, }, + setMemory: function() { + let me = this; + let viewModel = me.getViewModel(); + + if (me.insideWizard) { + let memory = me.down('pveMemoryField[name=memory]'); + // NOTE: we only set memory but that then sets balloon in its change handler + if (viewModel.get('current.ostype') === 'win11') { + memory.setValue('4096'); + } else { + memory.setValue('2048'); + } + } + }, + onGetValues: function(values) { var me = this; -- 2.30.2 _______________________________________________ pve-devel mailing list [email protected] https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
