Actualiser app/static/js/jury_but.js

Ajout de l'écoute des évènements KeyDown sur ArrowRight et ArrowLeft pour gérer le passage à l'étudiant suivant/précédent sur page Jury
This commit is contained in:
pascal.bouron 2025-02-05 16:07:12 +01:00
parent 7a59820558
commit 2a3e63f1a1

View File

@ -85,6 +85,19 @@ $(function () {
document.querySelector("div.prev").innerHTML = "";
document.querySelector("div.next").innerHTML = "";
}
$(document).keydown(function(event) {
if (event.key === "ArrowRight") {
let nextLink = $(".next a").attr("href");
if (nextLink) {
window.location.href = nextLink;
}
} else if (event.key === "ArrowLeft") {
let prevLink = $(".prev a").attr("href");
if (prevLink) {
window.location.href = prevLink;
}
}
});
});
// ----- Etat du formulaire jury pour éviter sortie sans enregistrer