Commit 6e60455f authored by Thomas Rientjes's avatar Thomas Rientjes
Browse files

Optimize the settings page script

parent ee5cca00
......@@ -20,7 +20,7 @@ window.onload = function () {
let controls = document.querySelectorAll('[data-setting-id]');
for (var index = 0, control; control = controls[index]; index++) {
for (let index = 0, control; control = controls[index]; index++) {
control.addEventListener('change', handleSettingAlteration);
}
};
......@@ -62,13 +62,11 @@ function handleSettingAlteration ({ target }) {
*/
function applySettings (settings) {
let settingIds = Object.keys(settings);
for (let setting in settings) {
settingIds.forEach(function (settingId) {
let setting = settings[settingId];
// Apply the setting to the user interface.
applySetting(setting);
});
}
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment