Skip to content

Commit

Permalink
Merge pull request Aircoookie#11 from Aircoookie/master
Browse files Browse the repository at this point in the history
Fixed Brightness slider beneath color wheel not working (fixes Aircoookie#1360)
  • Loading branch information
peacepenguin authored Nov 22, 2020
2 parents 1fb85b5 + bc45f8f commit 260408a
Show file tree
Hide file tree
Showing 4 changed files with 768 additions and 748 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

### Development versions after the 0.10.2 release

#### Build 2011210

- Fixed Brightness slider beneath color wheel not working (fixes #1360)
- Fixed invalid UI state after saving modified preset

#### Build 2011200

- Added HEX color receiving to JSON API with `"col":["RRGGBBWW"]` format
Expand Down
28 changes: 19 additions & 9 deletions wled00/data/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@
{
component: iro.ui.Slider,
options: {
sliderType: 'brightness'
sliderType: 'value'
}
},
{
Expand Down Expand Up @@ -1501,21 +1501,23 @@
var arr = Object.entries(pJson);
arr.sort(cmpP);
var added = false;
pQL = [];
pQL = [];
var is = [];

for (var key in arr)
{
if (!isObject(arr[key][1])) continue;
var i = parseInt(arr[key][0]);
var qll = arr[key][1]["ql"];
if (qll) pQL.push([i, qll]);
if (qll) pQL.push([i, qll]);
is.push(i);

cn += `<div class="seg pres" id="p${i}o">
<div class="segname pname" onclick="setPreset(${i})">
${pName(i)}
</div>
<i class="icons e-icon flr ${expanded[i+100] ? "exp":""}" id="sege${i+100}" onclick="expand(${i+100})">&#xe395;</i>
<div class="segin ${expanded[i+100] ? "expanded":""}" id="seg${i+100}">${expanded[i+100] ? makeP(i):""}</div>
<div class="segin" id="seg${i+100}"></div>
</div><br>`;
added = true;
}
Expand All @@ -1527,7 +1529,11 @@
pJson["0"] = {};
localStorage.setItem("wledP", JSON.stringify(pJson));
}
pmtLS = pmt;
pmtLS = pmt;
for (var a in is) {
var i = is[a];
if (expanded[i+100]) expand(i+100, true);
}
} else { presetError(true); }
updatePA();
populateQL();
Expand Down Expand Up @@ -2184,12 +2190,16 @@
}
obj["psave"] = pI; obj["n"] = pN;
var pQN = d.getElementById(`p${i}ql`).value;
if (pQN.length > 0) obj["ql"] = pQN;
if (pQN.length > 0) obj["ql"] = pQN;

showToast("Saving " + pN +" (" + pI + ")");
requestJson(obj);
if (obj["o"]) {
pJson[pI] = obj;
delete pJson[pI]["psave"];
delete pJson[pI]["psave"];
delete pJson[pI]["o"];
delete pJson[pI]["v"];
delete pJson[pI]["time"];
} else {
pJson[pI] = {"n":pN, "win":"Please refresh the page to see this newly saved command."};
if (obj["win"]) pJson[pI]["win"] = obj["win"];
Expand Down Expand Up @@ -2348,9 +2358,9 @@
requestJson(obj);
}

function expand(i)
function expand(i,a)
{
expanded[i] = !expanded[i];
if (!a) expanded[i] = !expanded[i];
d.getElementById('seg' +i).style.display = (expanded[i]) ? "block":"none";
d.getElementById('sege' +i).style.transform = (expanded[i]) ? "rotate(180deg)":"rotate(0deg)"
if (i > 100) { //presets
Expand Down
Loading

0 comments on commit 260408a

Please sign in to comment.