From e982814ab766865f108055894f2c447c57683324 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Mon, 9 Dec 2019 17:13:55 +0100 Subject: [PATCH] =?UTF-8?q?[9.2.15]=20accord=C3=A9on=20am=C3=A9lior=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.js.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/core.js.php b/core/core.js.php index 40bdfdb6..6bb61e27 100755 --- a/core/core.js.php +++ b/core/core.js.php @@ -423,9 +423,14 @@ $(document).ready(function(){ // au clic sur un titre... accordion.on('click', '.accordion-title', function(ev) { - ev.preventDefault(); - // ...on lance l'affichage de l'élément, avec animation - open($(this).closest('.accordion-item'), toggleSpeed); + ev.preventDefault(); + // Masquer l'élément déjà actif + if ($(this).closest('.accordion-item').hasClass('active')) { + $(this).removeClass('active').next('.accordion-content').slideUp(toggleSpeed); + } else { + // ...on lance l'affichage de l'élément, avec animation + open($(this).closest('.accordion-item'), toggleSpeed); + } }); }); }); \ No newline at end of file