Reselect the input box after any button is pressed
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Julius 2022-12-15 18:11:32 +01:00
parent 35bea09857
commit 6fd4739dad
Signed by: j00lz
GPG key ID: AF241B0AA237BBA2

View file

@ -6,15 +6,15 @@
<h2>Modus</h2>
<div class="form-group">
<label class="form-radio form-inline">
<input type="radio" name="mode" value="false" checked=""><i class="form-icon"></i> Toevoegen
<input type="radio" name="mode" value="false" checked="" onclick="reselect()"><i class="form-icon"></i> Toevoegen
</label>
<label class="form-radio form-inline">
<input type="radio" name="mode" value="true"><i class="form-icon"></i> Controleren
<input type="radio" name="mode" value="true"><i class="form-icon" onclick="reselect()"></i> Controleren
</label>
</div>
<h2>Informatie</h2>
<div>
<p><select id="videoSource"></select><button class="btn btn-primary" id="start_scan_btn">Start
<p><select id="videoSource"></select><button class="btn btn-primary" id="start_scan_btn" onclick="reselect()">Start
Scannen</button> </p>
<div class="columns">
<video autoplay playsinline controls="false" class="column col-12"></video>
@ -24,7 +24,7 @@
<h3>Binnen/Betaald: <span id="stats">Laden...</span></h3>
<h3>
<label class="form-checkbox form-inline">
<input type="checkbox" id="muntjes" ><i class="form-icon"></i> Muntjes kopen
<input type="checkbox" id="muntjes" onclick="reselect()"><i class="form-icon"></i> Muntjes kopen
</label>
</h3>
</div>
@ -76,6 +76,12 @@
}
}
function reselect() {
let elem = document.getElementById("student_number");
elem.focus();
elem.select();
}
function set_scan_status(status) {
document.getElementById("scan-status").innerHTML = status;
}
@ -296,10 +302,8 @@
document.getElementById("file-selector-button").addEventListener("click", upload_csv);
let elem = document.getElementById("student_number");
elem.focus();
elem.select();
fetch_stats();
reselect();
</script>
{% endblock %}