Commit 6d55435a authored by Mat's avatar Mat

ajoute un bouton reload pour rafraîchir la page

parent 47ab85ba
......@@ -8,8 +8,12 @@
<h3>Créer</h3>
<a href="javascript: void(0);" class="btn btn-create">
<i class="fas fa-plus fa-fw"></i> Nouvel auteur
</a><br>
<a href="javascript: void(0);" class="btn btn-reload">
<i class="fas fa-sync-alt fa-fw"></i> Rafraichir
</a>
<div class="hidden" style="margin-top: 1em;">
......@@ -111,16 +115,20 @@
// form[name^="owner"] .. regex, qui commence par owner
let createBtns = document.querySelectorAll('.btn-create');
// ou for (let currentBtn of createBtns)
createBtns.forEach(function(currentBtn){
// 'e' veut dire 'event'
currentBtn.addEventListener('click', function(e){
createBtns.forEach(function(currentBtn){ // ou for (let currentBtn of createBtns)
currentBtn.addEventListener('click', function(e){ // 'e' veut dire 'event'
form.parentNode.classList.remove('hidden');
});
});
let reloadBtns = document.querySelectorAll('.btn-reload');
reloadBtns.forEach(function(reloadBtn) {
reloadBtn.addEventListener('dblclick', function (e) {
reloadTableOwner();
});
});
form.addEventListener('submit', function(e) {
// Annule l'événement, mais préserve la fonction callback
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment