This commit is contained in:
Blaž Kristan
2025-11-03 14:14:37 +01:00
parent 454c73009a
commit 72fc016d7e

View File

@@ -602,9 +602,8 @@ Swap: <select id="xw${s}" name="XW${s}">
function addBtn(i,p,t) { function addBtn(i,p,t) {
var b = gId("btns"); var b = gId("btns");
var c = b.innerHTML;
var s = chrID(i); var s = chrID(i);
c += `<div id="btn${i}">#${i} GPIO: <input type="number" name="BT${s}" onchange="UI()" min="-1" max="${d.max_gpio}" class="xs" value="${p}">`; var c = `<div id="btn${i}">#${i} GPIO: <input type="number" name="BT${s}" onchange="UI()" min="-1" max="${d.max_gpio}" class="xs" value="${p}">`;
c += `&nbsp;<select name="BE${s}">` c += `&nbsp;<select name="BE${s}">`
c += `<option value="0" ${t==0?"selected":""}>Disabled</option>`; c += `<option value="0" ${t==0?"selected":""}>Disabled</option>`;
c += `<option value="2" ${t==2?"selected":""}>Pushbutton</option>`; c += `<option value="2" ${t==2?"selected":""}>Pushbutton</option>`;
@@ -617,8 +616,9 @@ Swap: <select id="xw${s}" name="XW${s}">
c += `<option value="9" ${t==9?"selected":""}>Touch (switch)</option>`; c += `<option value="9" ${t==9?"selected":""}>Touch (switch)</option>`;
c += `</select>`; c += `</select>`;
c += `<span style="cursor: pointer;" onclick="off('BT${s}')">&nbsp;&#x2715;</span><br></div>`; c += `<span style="cursor: pointer;" onclick="off('BT${s}')">&nbsp;&#x2715;</span><br></div>`;
b.innerHTML = c; b.insertAdjacentHTML("beforeend", c);
btnBtn(); btnBtn();
pinDropdowns();
UI(); UI();
} }
function remBtn() { function remBtn() {
@@ -626,6 +626,7 @@ Swap: <select id="xw${s}" name="XW${s}">
if (b.children.length <= 1) return; if (b.children.length <= 1) return;
b.lastElementChild.remove(); b.lastElementChild.remove();
btnBtn(); btnBtn();
pinDropdowns();
UI(); UI();
} }
function btnBtn() { function btnBtn() {