From 6115565520202303419fbb3c351dc3043d12c6c8 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 9 Dec 2019 20:31:19 +0100 Subject: [PATCH] =?UTF-8?q?[9.2.12]=20am=C3=A9liorationscript=20accord?= =?UTF-8?q?=C3=A9on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/core.js.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/core.js.php b/core/core.js.php index 6bb61e27..64bef0b9 100755 --- a/core/core.js.php +++ b/core/core.js.php @@ -417,6 +417,10 @@ $(document).ready(function(){ item.addClass('active') .find('.accordion-content').slideDown(speed); } + function close(item, speed) { + accordion.find('.accordion-item').removeClass('active') + .find('.accordion-content').slideUp(speed); + } // on initialise l'accordéon, sans animation open(accordion.find('.active:first'), 0); @@ -426,7 +430,7 @@ $(document).ready(function(){ ev.preventDefault(); // Masquer l'élément déjà actif if ($(this).closest('.accordion-item').hasClass('active')) { - $(this).removeClass('active').next('.accordion-content').slideUp(toggleSpeed); + close($(this).closest('.accordion-item'), toggleSpeed); } else { // ...on lance l'affichage de l'élément, avec animation open($(this).closest('.accordion-item'), toggleSpeed);