1
0
generated from avinay/discord-bot
Files
2026-06-04 16:01:31 +02:00

11 lines
418 B
JavaScript
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
function toggleArticle(btn) {
const article = btn.closest('.article');
const body = article.querySelector('.article-body');
const isOpen = body.style.display === 'block';
body.style.display = isOpen ? 'none' : 'block';
btn.classList.toggle('open', !isOpen);
btn.innerHTML = isOpen
? 'Lire <span class="toggle-arrow"></span>'
: 'Fermer <span class="toggle-arrow"></span>';
}