Affiche une animation après soumission d'un formulaire

This commit is contained in:
Tom Hubrecht 2021-05-26 23:44:46 +02:00
parent a03520f318
commit df513938cf
14 changed files with 24 additions and 13 deletions

View file

@ -16,7 +16,7 @@
<div class="field is-grouped is-centered"> <div class="field is-grouped is-centered">
<div class="control is-expanded"> <div class="control is-expanded">
<button class="button is-fullwidth is-outlined is-primary is-light"> <button class="button is-fullwidth is-outlined is-primary is-light" type="submit">
<span class="icon"> <span class="icon">
<i class="fas fa-check"></i> <i class="fas fa-check"></i>
</span> </span>

View file

@ -38,7 +38,7 @@
<div class="field"> <div class="field">
<div class="control"> <div class="control">
<button class="button is-fullwidth is-outlined is-primary is-light">{% trans "Enregistrer" %}</button> <button class="button is-fullwidth is-outlined is-primary is-light" type="submit">{% trans "Enregistrer" %}</button>
</div> </div>
</div> </div>
</form> </form>

View file

@ -40,7 +40,7 @@
<div class="field is-grouped is-centered"> <div class="field is-grouped is-centered">
<div class="control is-expanded"> <div class="control is-expanded">
<button class="button is-fullwidth is-outlined is-primary is-light"> <button class="button is-fullwidth is-outlined is-primary is-light" type="submit">
<span class="icon"> <span class="icon">
<i class="fas fa-check"></i> <i class="fas fa-check"></i>
</span> </span>

View file

@ -27,7 +27,7 @@
<div class="field is-grouped is-centered"> <div class="field is-grouped is-centered">
<div class="control is-expanded"> <div class="control is-expanded">
<button class="button is-fullwidth is-outlined is-primary is-light"> <button class="button is-fullwidth is-outlined is-primary is-light" type="submit">
<span class="icon"> <span class="icon">
<i class="fas fa-check"></i> <i class="fas fa-check"></i>
</span> </span>

View file

@ -22,7 +22,7 @@
<div class="field is-grouped is-centered"> <div class="field is-grouped is-centered">
<div class="control is-expanded"> <div class="control is-expanded">
<button class="button is-fullwidth is-outlined is-primary is-light"> <button class="button is-fullwidth is-outlined is-primary is-light" type="submit">
<span class="icon"> <span class="icon">
<i class="fas fa-check"></i> <i class="fas fa-check"></i>
</span> </span>

View file

@ -78,7 +78,7 @@
<div class="field is-grouped is-centered"> <div class="field is-grouped is-centered">
<div class="control is-expanded"> <div class="control is-expanded">
<button class="button is-fullwidth is-outlined is-primary is-light"> <button class="button is-fullwidth is-outlined is-primary is-light" type="submit">
<span class="icon"> <span class="icon">
<i class="fas fa-check"></i> <i class="fas fa-check"></i>
</span> </span>

View file

@ -62,7 +62,7 @@
</section> </section>
<footer class="modal-card-foot"> <footer class="modal-card-foot">
<button class="button is-fullwidth is-outlined is-primary is-light"> <button class="button is-fullwidth is-outlined is-primary is-light" type="submit">
<span class="icon"> <span class="icon">
<i class="fas fa-check"></i> <i class="fas fa-check"></i>
</span> </span>

View file

@ -16,7 +16,7 @@
<div class="field is-grouped is-centered"> <div class="field is-grouped is-centered">
<div class="control is-expanded"> <div class="control is-expanded">
<button class="button is-fullwidth is-outlined is-primary is-light"> <button class="button is-fullwidth is-outlined is-primary is-light" type="submit">
<span class="icon"> <span class="icon">
<i class="fas fa-check"></i> <i class="fas fa-check"></i>
</span> </span>

View file

@ -18,7 +18,7 @@
<div class="field is-grouped is-centered"> <div class="field is-grouped is-centered">
<div class="control is-expanded"> <div class="control is-expanded">
<button class="button is-fullwidth is-outlined is-primary is-light"> <button class="button is-fullwidth is-outlined is-primary is-light" type="submit">
<span class="icon"> <span class="icon">
<i class="fas fa-check"></i> <i class="fas fa-check"></i>
</span> </span>

View file

@ -18,7 +18,7 @@
<div class="field is-grouped is-centered"> <div class="field is-grouped is-centered">
<div class="control is-expanded"> <div class="control is-expanded">
<button class="button is-fullwidth is-outlined is-primary is-light"> <button class="button is-fullwidth is-outlined is-primary is-light" type="submit">
<span class="icon"> <span class="icon">
<i class="fas fa-check"></i> <i class="fas fa-check"></i>
</span> </span>

View file

@ -18,7 +18,7 @@
<div class="field is-grouped is-centered"> <div class="field is-grouped is-centered">
<div class="control is-expanded"> <div class="control is-expanded">
<button class="button is-fullwidth is-outlined is-primary is-light"> <button class="button is-fullwidth is-outlined is-primary is-light" type="submit">
<span class="icon"> <span class="icon">
<i class="fas fa-check"></i> <i class="fas fa-check"></i>
</span> </span>

View file

@ -18,7 +18,7 @@
<div class="field is-grouped is-centered"> <div class="field is-grouped is-centered">
<div class="control is-expanded"> <div class="control is-expanded">
<button class="button is-fullwidth is-outlined is-primary is-light"> <button class="button is-fullwidth is-outlined is-primary is-light" type="submit">
<span class="icon"> <span class="icon">
<i class="fas fa-check"></i> <i class="fas fa-check"></i>
</span> </span>

View file

@ -92,6 +92,17 @@
}); });
}); });
// Disable button after form submission
var $forms = document.querySelectorAll('form');
$forms.forEach($form => {
const $submit = $form.querySelector('button[type=submit]');
$form.addEventListener('submit', () => {
$submit.classList.add('is-loading');
});
});
}); });
</script> </script>

View file

@ -16,7 +16,7 @@
</section> </section>
<footer class="modal-card-foot"> <footer class="modal-card-foot">
<button class="button is-fullwidth is-outlined is-primary is-light"> <button class="button is-fullwidth is-outlined is-primary is-light" type="submit">
<span class="icon"> <span class="icon">
<i class="fas fa-check"></i> <i class="fas fa-check"></i>
</span> </span>