splitting all js into individual files to comparmentalize and getting rid of onload event (in favour of defer)

This commit is contained in:
Simon Martens
2022-11-15 21:27:27 +01:00
parent e5052dd4ea
commit 5e90e917f1
30 changed files with 771 additions and 809 deletions

View File

@@ -0,0 +1,14 @@
const ACTIVATESEARCHFILTER = function(filter, button) {
let f = filter.value;
if (f === "") {
button.disabled = true;
return;
}
button.disabled = false;
}
let searchfilter = document.getElementById("ha-searchformtext");
let searchsubmitbtn = document.getElementById("ha-searchformsubmit");
let searchform = document.getElementById("ha-searchform");
ACTIVATESEARCHFILTER(searchfilter, searchsubmitbtn);
searchfilter.addEventListener("input", () => ACTIVATESEARCHFILTER(searchfilter, searchsubmitbtn));