Skip to content

Commit

Permalink
Options for disabling an element by name and #
Browse files Browse the repository at this point in the history
  • Loading branch information
troyhacks committed Oct 20, 2023
1 parent 3ba2fe4 commit f4cf67c
Show file tree
Hide file tree
Showing 5 changed files with 961 additions and 943 deletions.
2 changes: 2 additions & 0 deletions usermods/audioreactive/audio_reactive.h
Original file line number Diff line number Diff line change
Expand Up @@ -2735,6 +2735,8 @@ class AudioReactive : public Usermod {
oappend(SET_F("xOpt('AudioReactive:digitalmic:pin[]',5,' ⎌',")); oappendi(ES7243_SCLPIN); oappend(");");
#endif
oappend(SET_F("dRO('AudioReactive:digitalmic:pin[]',5);")); // disable read only pins
oappend(SET_F("disableElement('AudioReactive:digitalmic:pin[]',4);"));
oappend(SET_F("disableElement('AudioReactive:digitalmic:pin[]',5);"));
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion wled00/const.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
#ifdef ESP8266
#define SETTINGS_STACK_BUF_SIZE 2048
#else
#define SETTINGS_STACK_BUF_SIZE 3802 // WLEDMM added 696+10 bytes of margin (was 3096) for audioreactive UI
#define SETTINGS_STACK_BUF_SIZE 3902 // WLEDMM added 696+10+50+50 bytes of margin (was 3096) for audioreactive UI
#endif

#ifdef WLED_USE_ETHERNET
Expand Down
14 changes: 14 additions & 0 deletions wled00/data/settings_um.htm
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,20 @@
//https://www.javascripttutorial.net/javascript-dom/javascript-remove-items-from-a-select-conditionally/
}
}
//WLEDMM: disable element by name
function disableElement(name,el) {
let obj = d.getElementsByName(name);
var select = obj;
if (obj[el]) select = obj[el];
select.disabled = true;
}
//WLEDMM: hide element by name
function hideElement(name,el) {
let obj = d.getElementsByName(name);
var select = obj;
if (obj[el]) select = obj[el];
select.display = false;
}
//WLEDMM: analog options only
function aOpt(name,el) {
let obj = d.getElementsByName(name);
Expand Down
Loading

0 comments on commit f4cf67c

Please sign in to comment.