diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js index c5eeffb23cee38f17136e583c99882d575350bf8..22cb7d2e0bd544d5ec20ae29c472f5b17f381e07 100644 --- a/src/scripts/coopstarter.js +++ b/src/scripts/coopstarter.js @@ -88,8 +88,8 @@ function refreshPagination() { .textContent == 1) ) { resources_container.nextSibling.setAttribute("style", "display:none"); - } else if (resources_container.nextSibling) { - resources_container.nextSibling.setAttribute("style", "display:block"); + } else if (resources_container.nextSibling && resources_container.closest(".step").querySelector('.accordion:not(.active)')) { + resources_container.nextSibling.setAttribute("hidden", "hidden"); } } } @@ -459,6 +459,8 @@ jQuery(document).ready(function($) { for (i = 0; i < acc.length; i++) { acc[i].addEventListener("click", function() { this.classList.toggle("active"); + this.closest(".step").querySelector('nav').removeAttribute("hidden"); + refreshPagination() var panel = this.nextElementSibling.querySelector("sib-form + div"); @@ -467,8 +469,11 @@ jQuery(document).ready(function($) { } else { panel.style.maxHeight = panel.scrollHeight + "px"; } + }); + } + refreshPagination() }, 2000); //In the entrepreneur dashboard, we set data from the display form to the hidden ones.