From b6450910cea2469fc9d5af817cffea38aba6b070 Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Thu, 25 Jan 2018 15:55:11 +0100 Subject: [PATCH] fix #1629: improve min/max memory handling instead of directly setting the minvalue when the maxvalue is lower we invalidate it and only on blur we set the minvalue without this we lose the minvalue when editing only the maxvalue e.g.: Max: 2048 Min: 1024 if we now edit the maxvalue to 4096, on pressing the '4', we are setting the minvalue to '4' because 4 is lower than 1024 Signed-off-by: Dominik Csapak --- www/manager6/qemu/MemoryEdit.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/www/manager6/qemu/MemoryEdit.js b/www/manager6/qemu/MemoryEdit.js index 1974abc4..6fda271b 100644 --- a/www/manager6/qemu/MemoryEdit.js +++ b/www/manager6/qemu/MemoryEdit.js @@ -99,12 +99,18 @@ Ext.define('PVE.qemu.MemoryInputPanel', { labelWidth: labelWidth, listeners: { change: function(f, value) { + var bf = me.down('field[name=balloon]'); + var balloon = bf.getValue(); + bf.setMaxValue(value); + bf.validate(); + }, + blur: function(f) { + var value = f.getValue(); var bf = me.down('field[name=balloon]'); var balloon = bf.getValue(); if (balloon > value) { bf.setValue(value); } - bf.setMaxValue(value); } } },