add onload event to body

This commit is contained in:
Woody 2023-12-19 21:12:07 +01:00
parent 5cd8f5681e
commit 0a91d60677
No known key found for this signature in database
GPG Key ID: 9872D7F5072789B2
2 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@
<title>WLED</title>
<link rel="stylesheet" href="index.css">
</head>
<body>
<body onload="onLoad()">
<div id="cv" class="overlay">Loading WLED UI...</div>
<noscript><div class="overlay" style="opacity:1;">Sorry, WLED UI needs JavaScript!</div></noscript>

View File

@ -24,7 +24,7 @@ var pN = "", pI = 0, pNum = 0;
var pmt = 1, pmtLS = 0, pmtLast = 0;
var lastinfo = {};
var isM = false, mw = 0, mh=0;
var ws, cpick, wsRpt=0;
var ws, wsRpt=0;
var cfg = {
theme:{base:"dark", bg:{url:"", rnd: false, rndGrayscale: false, rndBlur: false}, alpha:{bg:0.6,tab:0.8}, color:{bg:""}},
comp :{colors:{picker: true, rgb: false, quick: true, hex: false},
@ -40,7 +40,7 @@ var hol = [
[0,0,1,1,"https://images.alphacoders.com/119/1198800.jpg"] // new year
];
cpick = new iro.ColorPicker("#picker", {
var cpick = new iro.ColorPicker("#picker", {
width: 260,
wheelLightness: false,
wheelAngle: 270,
@ -50,8 +50,6 @@ cpick = new iro.ColorPicker("#picker", {
options: {}
}]
});
cpick.on("input:end", () => {setColor(1);});
cpick.on("color:change", () => {updatePSliders()});
function handleVisibilityChange() {if (!d.hidden && new Date () - lastUpdate > 3000) requestJson();}
function sCol(na, col) {d.documentElement.style.setProperty(na, col);}
@ -274,6 +272,8 @@ function onLoad()
selectSlot(0);
updateTablinks(0);
cpick.on("input:end", () => {setColor(1);});
cpick.on("color:change", () => {updatePSliders()});
pmtLS = localStorage.getItem('wledPmt');
// Load initial data