Skip to content

Commit

Permalink
hide/show disabled/enabled modules
Browse files Browse the repository at this point in the history
index.js: changeValue: th:mdlEnabled: hide/show disabled/enabled modules
  • Loading branch information
ewowi committed Mar 11, 2024
1 parent ab446c8 commit b8e9ca3
Show file tree
Hide file tree
Showing 2 changed files with 932 additions and 919 deletions.
12 changes: 11 additions & 1 deletion data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -792,8 +792,18 @@ function changeHTML(variable, commandJson, rowNr = UINT8_MAX) {
let max = Math.max(valueLength, trNodes.length);
for (let newRowNr = 0; newRowNr<max;newRowNr++) {
let newValue; // if not array then use the value for each row
if (Array.isArray(commandJson.value))
if (Array.isArray(commandJson.value)) {
newValue = commandJson.value[newRowNr];
//hide/show disabled/enabled modules
if (variable.id == "mdlEnabled") {
let mdlNode = gId(findVar("mdlName").value[newRowNr]);
// console.log("mdlEnabled", variable, node, newValue, newRowNr, mdlNameVar.value[newRowNr], mdlNode);
if (mdlNode) {
if (mdlNode.hidden && newValue) mdlNode.hidden = false;
if (!mdlNode.hidden && !newValue) mdlNode.hidden = true;
}
}
}
else
newValue = commandJson.value;

Expand Down
Loading

0 comments on commit b8e9ca3

Please sign in to comment.