diff options
author | Andrew Webster <awebster@arcx.com> | 2018-02-01 11:46:38 -0500 |
---|---|---|
committer | Andrew Webster <awebster@arcx.com> | 2018-02-13 10:22:36 -0500 |
commit | 8ad8f15cf6ea3a5417ee471d168a585f11f225bc (patch) | |
tree | 1e81e923e69396570ef589eafac6f1e85a9d410f | |
parent | e0750f9b2c1495473fdcbb2f22dd97961803bc81 (diff) | |
download | novnc-8ad8f15cf6ea3a5417ee471d168a585f11f225bc.tar.gz |
Move writeSetting from updateSetting to initSetting
initSetting was the only place that supplied a 'value' to
updateSetting. So move it to clean up updateSetting.
-rw-r--r-- | app/ui.js | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -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') { |