Merge remote-tracking branch 'origin/ac_main' into mdev
This commit is contained in:
@@ -184,18 +184,13 @@
|
||||
}
|
||||
}
|
||||
// https://stackoverflow.com/questions/26440494/insert-text-after-this-input-element-with-javascript
|
||||
//WLEDMM Add pre and post texts
|
||||
function addInfo(name,el,txt, txt2="") {
|
||||
let obj = d.getElementsByName(name);
|
||||
if (!obj.length) return;
|
||||
if (typeof el === "string" && obj[0]) obj[0].placeholder = el;
|
||||
else if (obj[el]) {
|
||||
if (txt2!="") {
|
||||
obj[el].insertAdjacentHTML('beforebegin', txt + ' ');
|
||||
obj[el].insertAdjacentHTML('afterend', ' '+txt2);
|
||||
}
|
||||
else
|
||||
obj[el].insertAdjacentHTML('afterend', ' '+txt);
|
||||
if (txt!="") obj[el].insertAdjacentHTML('afterend', ' '+txt);
|
||||
if (txt2!="") obj[el].insertAdjacentHTML('beforebegin', txt2 + ' '); //add pre texts
|
||||
}
|
||||
}
|
||||
// load settings and insert values into DOM
|
||||
|
||||
Reference in New Issue
Block a user