Add accordion toggle script for social accountability page

The ElementsKit accordion JS was removed during plugin cleanup.
Added lightweight inline script to handle expand/collapse behavior
for the accordion panels.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Adam Moussa 2026-04-04 18:55:33 -04:00
parent ccbc29c06b
commit d7a828f32e

View file

@ -972,6 +972,38 @@
document.querySelectorAll('.elementor-counter-number').forEach(function(el){cio.observe(el)});
})();
</script>
<script>
(function(){
document.querySelectorAll('[data-ekit-toggle="collapse"]').forEach(function(btn){
btn.addEventListener('click', function(e){
e.preventDefault();
var target = document.querySelector(btn.getAttribute('data-target'));
if(!target) return;
var isOpen = target.classList.contains('show');
// Close all siblings in same accordion
var parent = target.closest('.elementskit-accordion');
if(parent){
parent.querySelectorAll('.collapse.in').forEach(function(el){
el.classList.remove('show');
var t = el.closest('.elementskit-card');
if(t){
var a = t.querySelector('.elementskit-btn-link');
if(a){ a.classList.add('collapsed'); a.setAttribute('aria-expanded','false'); }
t.classList.remove('active');
}
});
}
if(!isOpen){
target.classList.add('show');
btn.classList.remove('collapsed');
btn.setAttribute('aria-expanded','true');
var card = btn.closest('.elementskit-card');
if(card) card.classList.add('active');
}
});
});
})();
</script>
</body>
<!-- Page supported by LiteSpeed Cache 6.5.4 on 2025-07-14 23:00:00 -->