mirror of
https://github.com/wled/WLED.git
synced 2025-07-15 23:06:36 +00:00
Fix for #3919
This commit is contained in:
parent
57665e8964
commit
6f3d7e76c9
@ -358,7 +358,7 @@ button {
|
||||
|
||||
#putil, #segutil, #segutil2 {
|
||||
min-height: 42px;
|
||||
margin: 13px auto 0;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
#segutil .segin {
|
||||
|
@ -863,14 +863,11 @@ function populateSegments(s)
|
||||
gId("segcont").classList.remove("hide");
|
||||
let noNewSegs = (lowestUnused >= maxSeg);
|
||||
resetUtil(noNewSegs);
|
||||
if (gId('selall')) gId('selall').checked = true;
|
||||
for (var i = 0; i <= lSeg; i++) {
|
||||
if (!gId(`seg${i}`)) continue;
|
||||
updateLen(i);
|
||||
updateTrail(gId(`seg${i}bri`));
|
||||
gId(`segr${i}`).classList.add("hide");
|
||||
//if (i<lSeg) gId(`segd${i}`).classList.add("hide"); // hide delete button for all but last
|
||||
if (!gId(`seg${i}sel`).checked && gId('selall')) gId('selall').checked = false; // uncheck if at least one is unselected.
|
||||
}
|
||||
if (segCount < 2) {
|
||||
gId(`segd${lSeg}`).classList.add("hide"); // hide delete if only one segment
|
||||
@ -1462,8 +1459,6 @@ function readState(s,command=false)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (s.seg.length>2) d.querySelectorAll(".pop").forEach((e)=>{e.classList.remove("hide");});
|
||||
|
||||
var cd = gId('csl').querySelectorAll("button");
|
||||
for (let e = cd.length-1; e >= 0; e--) {
|
||||
cd[e].dataset.r = i.col[e][0];
|
||||
@ -1838,7 +1833,7 @@ function makeSeg()
|
||||
});
|
||||
var cn = `<div class="seg lstI expanded">`+
|
||||
`<div class="segin">`+
|
||||
`<input type="text" id="seg${lu}t" autocomplete="off" maxlength=32 value="" placeholder="New segment ${lu}"/>`+
|
||||
`<input class="ptxt show" type="text" id="seg${lu}t" autocomplete="off" maxlength=32 value="" placeholder="New segment ${lu}"/>`+
|
||||
`<table class="segt">`+
|
||||
`<tr>`+
|
||||
`<td width="38%">${isM?'Start X':'Start LED'}</td>`+
|
||||
@ -1864,13 +1859,19 @@ function makeSeg()
|
||||
|
||||
function resetUtil(off=false)
|
||||
{
|
||||
gId('segutil').innerHTML = `<div class="seg btn btn-s${off?' off':''}" style="padding:0;">`
|
||||
gId('segutil').innerHTML = `<div class="seg btn btn-s${off?' off':''}" style="padding:0;margin-bottom:12px;">`
|
||||
+ '<label class="check schkl"><input type="checkbox" id="selall" onchange="selSegAll(this)"><span class="checkmark"></span></label>'
|
||||
+ `<div class="segname" ${off?'':'onclick="makeSeg()"'}><i class="icons btn-icon"></i>Add segment</div>`
|
||||
+ '<div class="pop hide" onclick="event.stopPropagation();">'
|
||||
+ `<i class="icons g-icon" title="Select group" onclick="this.nextElementSibling.classList.toggle('hide');"></i>`
|
||||
+ '<div class="pop-c hide"><span style="color:var(--c-f);" onclick="selGrp(0);">➊</span><span style="color:var(--c-r);" onclick="selGrp(1);">➋</span><span style="color:var(--c-g);" onclick="selGrp(2);">➌</span><span style="color:var(--c-l);" onclick="selGrp(3);">➍</span></div>'
|
||||
+ '</div></div>';
|
||||
gId('selall').checked = true;
|
||||
for (var i = 0; i <= lSeg; i++) {
|
||||
if (!gId(`seg${i}`)) continue;
|
||||
if (!gId(`seg${i}sel`).checked) gId('selall').checked = false; // uncheck if at least one is unselected.
|
||||
}
|
||||
if (lSeg>2) d.querySelectorAll("#Segments .pop").forEach((e)=>{e.classList.remove("hide");});
|
||||
}
|
||||
|
||||
function makePlSel(el, incPl=false)
|
||||
|
Loading…
x
Reference in New Issue
Block a user