Move writeSetting from updateSetting to initSetting

initSetting was the only place that supplied a 'value' to
updateSetting.  So move it to clean up updateSetting.
This commit is contained in:
Andrew Webster 2018-02-01 11:46:38 -05:00
parent e0750f9b2c
commit 8ad8f15cf6
1 changed files with 4 additions and 8 deletions

View File

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