mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 23:33:12 +09:00
Updated node details and settings style
Fixed nav spacing. Added a header to the storage table.
This commit is contained in:
1 parent
659b071eb6
commit
1788d72f8f
8 files changed
+88
-83
No files matched your search
+7
-5
@@ -3,6 +3,7 @@ if(localStorage.settings) {
|
||||
let settings = JSON.parse(localStorage.settings);
|
||||
|
||||
let HTML = "";
|
||||
|
||||
for(let key in settings) {
|
||||
HTML += drawSetting(key, settings[key]);
|
||||
}
|
||||
@@ -11,9 +12,9 @@ if(localStorage.settings) {
|
||||
|
||||
window.onload = function(){
|
||||
// loop through all settings and add onclick events for them
|
||||
let thingies = document.querySelectorAll(".settingsBox .switch .slider");
|
||||
for(let i = 0; i < thingies.length; i++) {
|
||||
thingies[i].onclick = function() {
|
||||
let sliders = document.querySelectorAll(".settings-box .switch .slider");
|
||||
for(let i = 0; i < sliders.length; i++) {
|
||||
sliders[i].onclick = function() {
|
||||
let settings = JSON.parse(localStorage.settings);
|
||||
|
||||
// walk through DOM structure created by drawSetting and update localstorage from that
|
||||
@@ -26,8 +27,9 @@ window.onload = function(){
|
||||
};
|
||||
|
||||
function drawSetting(settingText, checked) {
|
||||
let HTML = '<div class="settingsBox">' +
|
||||
'<label class="switch"><input type="checkbox" ' + checked + '' +
|
||||
|
||||
let HTML = '<div class="settings-box">' +
|
||||
'<label class="switch"><input type="checkbox" checked="' + checked + '"' +
|
||||
'><div class="slider round"></div></label><span class="settings-text ml-3 align-middle">' + settingText + '</span></div>';
|
||||
return HTML;
|
||||
}
|
||||
Reference in new issue
Block a user