]> git.proxmox.com Git - mirror_novnc.git/commitdiff
Move writeSetting from updateSetting to initSetting
authorAndrew Webster <awebster@arcx.com>
Thu, 1 Feb 2018 16:46:38 +0000 (11:46 -0500)
committerAndrew Webster <awebster@arcx.com>
Tue, 13 Feb 2018 15:22:36 +0000 (10:22 -0500)
initSetting was the only place that supplied a 'value' to
updateSetting.  So move it to clean up updateSetting.

app/ui.js

index 7c754cecdef9684c6ed7216083ae5e813209ef26..592dfcf77706b0e8b5fcff39c9a106e0f6239d19 100644 (file)
--- a/app/ui.js
+++ b/app/ui.js
@@ -721,21 +721,17 @@ var UI = {
         if (val === null) {
             val = WebUtil.readSetting(name, defVal);
         }
-        UI.updateSetting(name, val);
+        WebUtil.setSetting(name, val);
+        UI.updateSetting(name);
         return val;
     },
 
     // Update cookie and form control setting. If value is not set, then
     // updates from control to current cookie setting.
-    updateSetting: function(name, value) {
-
-        // Save the cookie for this session
-        if (typeof value !== 'undefined') {
-            WebUtil.setSetting(name, value);
-        }
+    updateSetting: function(name) {
 
         // Update the settings control
-        value = UI.getSetting(name);
+        var value = UI.getSetting(name);
 
         var ctrl = document.getElementById('noVNC_setting_' + name);
         if (ctrl.type === 'checkbox') {