Skip to content

Commit

Permalink
Further changes from testing
Browse files Browse the repository at this point in the history
  • Loading branch information
md8n committed Dec 20, 2024
1 parent 9bae3f6 commit 72abacd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
12 changes: 6 additions & 6 deletions www/js/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,12 @@ function processMacroSave(answer) {
}
}

function control_build_macro_button(entry) {
function control_build_macro_button(index, entry) {
const noGlyph = entry.glyph.length === 0;
const btnStyle = noGlyph ? " style='display:none'" : "";
const entryIcon = get_icon_svg(noGlyph ? "star" : entry.glyph);

let content = `<button id="control_macro_${i}" class='btn fixedbutton ${entry.class}' type='text'${btnStyle}>`;
let content = `<button id="control_macro_${index}" class='btn fixedbutton ${entry.class}' type='text'${btnStyle}>`;
content += `<span style='position:relative; top:3px;'>${entryIcon}</span>${entry.name.length > 0 ? "&nbsp;" : ""}${entry.name}`;
content += "</button>";

Expand Down Expand Up @@ -297,13 +297,13 @@ function control_build_macro_ui() {
content += "</div>";
for (var i = 0; i < 9; i++) {
const entry = control_macrolist[i];
content += control_build_macro_button(entry);
content += control_build_macro_button(i, entry);
actions.push({ id: `control_macro_${i}`, type: "click", method: macro_command(entry.target, entry.filename) });
}
id('Macro_list').innerHTML = content;
for (const action in actions) {
id("Macro_list").innerHTML = content;
actions.forEach((action) => {
id(action.id).addEventListener(action.type, (event) => action.method);
}
});
}

function macro_command(target, filename) {
Expand Down
4 changes: 2 additions & 2 deletions www/js/scanwifidlg.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ function process_scanWifi_answer(response_text) {
}
setHTML("AP_scan_data", content);

for(const action in actions) {
actions.forEach((action) => {
id(action.id).addEventListener(action.type, (event) => action.method);
};
});

return result;
}
Expand Down
1 change: 0 additions & 1 deletion www/js/utilValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ const valueIsText = (value, valueDef) => {
* success is an empty array,
* failure is an array of one or more error messages */
const checkValue = (value, valueDef, errorList = []) => {
const errorList = [];
switch (valueDef.valueType) {
case "int": errorList.push(valueIsInt(value, valueDef)); break;
case "float": errorList.push(valueIsFloat(value, valueDef)); break;
Expand Down

0 comments on commit 72abacd

Please sign in to comment.