From edad1fbc8bdb7c30829ad57df0b3a8703cdbb83c Mon Sep 17 00:00:00 2001
From: RealET <real3t@gmail.com>
Date: Sun, 14 Mar 2021 17:54:09 +0100
Subject: [PATCH] =?UTF-8?q?ref=20#4695=20:=20calcul=20des=20plugins=20affi?=
 =?UTF-8?q?ch=C3=A9s=20r=C3=A9ellement?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 formulaires/admin_plugin.html | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/formulaires/admin_plugin.html b/formulaires/admin_plugin.html
index 35e9bf6..b0d7d5d 100644
--- a/formulaires/admin_plugin.html
+++ b/formulaires/admin_plugin.html
@@ -52,7 +52,7 @@
 					var elements_maj = $('.plugins li.item.up');
 
 					// afficher le nombre de plugin au chargement de la page
-					calculer_nbr_plugin(tous_les_elements);
+					calculer_nbr_plugin_affiche();
 					calculer_nbr_plugin_maj(elements_maj, '#nbr_plugin_maj');
 
 					// on filtre les plugins
@@ -68,7 +68,7 @@
 						elements_trouves.show();
 
 						// recalculer le nombre de plugin
-						calculer_nbr_plugin(elements_trouves);
+						calculer_nbr_plugin_affiche();
 					});
 					
 					// on filtre les plugins qui peuvent être mis à jour
@@ -78,11 +78,11 @@
 							tous_les_elements.hide();
 							elements_maj.show();
 							// recalculer le nombre de plugin
-							calculer_nbr_plugin(elements_maj);
+							calculer_nbr_plugin_affiche();
 						} else {
 							tous_les_elements.show();
 							// recalculer le nombre de plugin
-							calculer_nbr_plugin(tous_les_elements);
+							calculer_nbr_plugin_affiche();
 						}
 					});
 
@@ -134,8 +134,8 @@
 						}
 					}
 
-					function calculer_nbr_plugin(liste_plugins){
-						var nbr_plugin = liste_plugins.length;
+					function calculer_nbr_plugin_affiche(){
+						var nbr_plugin = $('div#liste_plugins ul > li').filter(":visible").length;
 						if (nbr_plugin > 1){
 							var texte = '<:svp:info_nb_plugins|texte_script:>';
 							texte = texte.replace('@nb@', nbr_plugin);
-- 
GitLab