]> git.proxmox.com Git - pve-manager.git/commitdiff
ui settings: fix noVNC scaling mode radiogroup setValue
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 21 Oct 2019 13:20:11 +0000 (15:20 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 21 Oct 2019 13:20:22 +0000 (15:20 +0200)
radio groups set and get Value helper are objects, as they are
expected to be key, value, where key is a field-name of the radio
group and values is the inputValue from the radiobutton to be set.

So ensure we extract only the value in the change event handler, as
we do not want to save the whole object. But on restoring (setValue)
we need to wrap it as object again, else radiogroup won't know what
field we want to set..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/window/Settings.js

index 910389ec45f5ab9e6dccb7b25d6d063edcd37560..0a6247fcd769506c76570bac8d9ee5a4fa05f8fe 100644 (file)
@@ -39,7 +39,7 @@ Ext.define('PVE.window.Settings', {
            me.lookupReference('savedUserName').setValue(username);
            var vncMode = sp.get('novnc-scaling');
            if (vncMode !== undefined) {
-               me.lookupReference('noVNCScalingGroup').setValue(vncMode);
+               me.lookupReference('noVNCScalingGroup').setValue({ noVNCScalingField: vncMode });
            }
 
            var settings = ['fontSize', 'fontFamily', 'letterSpacing', 'lineHeight'];
@@ -377,7 +377,7 @@ Ext.define('PVE.window.Settings', {
                        listeners: {
                            change: function(el, newValue, undefined) {
                                var sp = Ext.state.Manager.getProvider();
-                               sp.set('novnc-scaling', newValue);
+                               sp.set('novnc-scaling', newValue.noVNCScalingField);
                            }
                        },
                    },