From 2daacc8efd1d1150b1515a6ceda4f69a1440e120 Mon Sep 17 00:00:00 2001 From: cy_altern Date: Sun, 10 Apr 2022 13:02:35 +0200 Subject: [PATCH] =?UTF-8?q?en=20cas=20d'utilisation=20d'un=20lien/clic=20a?= =?UTF-8?q?vec=20.url=5Faction,=20passer=20une=20=C3=A9ventuelle=20icone?= =?UTF-8?q?=20(.fa=20ou=20.icone)=20en=20refresh=20anim=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- js/gamutable.es6.js | 4 ++++ js/gamutable.js | 7 ++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 13dd130..0b24e98 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ Choisir entre la version minifiée de vuejs (sans le debug) ou la version de dev ``` * il faut ajouter data-confirm="Confirmez vous ..." si on veut ajouter un popin de confirmation * il faut ajouter data-id="" si on veut recharger que cette ligne -* si une variable du nom de `nomBlocAjaxReload` est définie, alors, un ajaxReload de ce bloc sera joué dans la fonctione de callback de l'action +* si une variable du nom de `nomBlocAjaxReload` est définie (ou un id-ajaxreload), alors, un ajaxReload de ce bloc sera joué dans la fonctione de callback de l'action ## Utiliser les crayons : diff --git a/js/gamutable.es6.js b/js/gamutable.es6.js index 414fc73..8e95ced 100644 --- a/js/gamutable.es6.js +++ b/js/gamutable.es6.js @@ -10,6 +10,10 @@ jQuery(function () { } let url = $(this).attr('href'); let id = $(this).data('id'); + // passer en refresh animé une éventuelle icone + if ($(this).has('i.icon, i.fa')) { + $(this).find('i.icon, i.fa').eq(0).replaceWith(''); + } nomBlocAjaxReload = $(this).data('ajaxreload'); console.time('Chargement de VueJs APRES Ajax'); $.ajax({ diff --git a/js/gamutable.js b/js/gamutable.js index c7bce84..8fe2976 100644 --- a/js/gamutable.js +++ b/js/gamutable.js @@ -35,7 +35,12 @@ jQuery(function () { } var url = $(this).attr('href'); - var id = $(this).data('id'); + var id = $(this).data('id'); // passer en refresh animé une éventuelle icone + + if ($(this).has('i.icon, i.fa')) { + $(this).find('i.icon, i.fa').eq(0).replaceWith(''); + } + nomBlocAjaxReload = $(this).data('ajaxreload'); console.time('Chargement de VueJs APRES Ajax'); $.ajax({