fjerna død kode
This commit is contained in:
parent
004474c2e1
commit
be878ac77e
@ -88,22 +88,16 @@ function register_runner(id) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
update()
|
update()
|
||||||
//document.getElementById("search").focus()
|
document.getElementById("search").focus()
|
||||||
};
|
};
|
||||||
function create_rows(csv) {
|
|
||||||
csv = csv.split('\n')
|
|
||||||
rows = "<tr><th>#</th><th>Navn</th><th></th>";
|
|
||||||
for (i in csv) {
|
|
||||||
data = csv[i].split(",")
|
|
||||||
rows += create_row(data[0], data[1], false)
|
|
||||||
}
|
|
||||||
return rows
|
|
||||||
}
|
|
||||||
function filterTable() {
|
function filterTable() {
|
||||||
var input, filter, table, tr, td, i, txtValue;
|
var input, filter, table, tr, td, i, txtValue;
|
||||||
input = document.getElementById("search");
|
input = document.getElementById("search");
|
||||||
filter = input.value;
|
filter = input.value;
|
||||||
table = document.getElementById("runners").getElementsByTagName("tbody")[0];
|
table = document.getElementById("runners").getElementsByTagName("tbody")[0];
|
||||||
|
if (!table) {
|
||||||
|
setTimeout(filterTable, 100);
|
||||||
|
}
|
||||||
tr = table.getElementsByTagName("tr");
|
tr = table.getElementsByTagName("tr");
|
||||||
|
|
||||||
if (filter == "") {
|
if (filter == "") {
|
||||||
@ -123,21 +117,15 @@ function filterTable() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function update_row(id, name, passed) {
|
|
||||||
row = document.getElementById(id)
|
|
||||||
row.innerHTML = create_row(id, name, passed)
|
|
||||||
row.classList.add("bg-success");
|
|
||||||
}
|
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
const table = document.getElementById("runners");
|
const table = document.getElementById("runners");
|
||||||
control = get_control();
|
control = get_control();
|
||||||
const myRequest = new Request(`table.php?registrering,`+control);
|
let request = new Request(`table.php?registrering,`+control);
|
||||||
fetch(myRequest)
|
fetch(request)
|
||||||
.then((response) => response.text())
|
.then((response) => response.text())
|
||||||
.then((text) => {
|
.then((text) => {table.innerHTML = text;})
|
||||||
table.innerHTML = text;
|
filterTable()
|
||||||
});
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
Reference in New Issue
Block a user