mis dans le js + fix quelques problemes

This commit is contained in:
piair
2023-09-30 19:30:42 +02:00
parent 43188f65ac
commit e2ab390b01
4 changed files with 23 additions and 23 deletions

View File

@ -9,27 +9,7 @@
{% else %}
<script>data = JSON.parse('{{configs|tojson}}'); </script>
<script>
function change_override(value, data) {
for (let i = 1; i < 6; i++) {
document.getElementById("compte_"+ i).innerHTML = data[parseInt(value)]['accounts'][i]["mail"];
if (!(data[parseInt(value)]['accounts'][i]["mail"])){
console.log("hiding" + i);
for (let j = 1; j <= 5; j++) {
document.getElementById(i.toString() +j.toString()).style.visibility = "hidden";
}
} else {
console.log("showing" + i);
for (let j = 1; j <= 5; j++) {
console.log("element " + i.toString()+j.toString());
document.getElementById(i.toString()+j.toString()).style.visibility = "visible";
}
}
}
}
</script>
<form method="post" action="/override/" height="90%">
<select onchange="change_override(this.value, data)" name="config">
<option id="-1" value="-1" selected>Select a config</option>