|
|
|
|
@ -1,7 +1,8 @@
|
|
|
|
|
document.querySelectorAll('.more-link').forEach(link => { |
|
|
|
|
link.addEventListener('click', (e) => { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
const container = link.previousElementSibling; |
|
|
|
|
// Find the parent text-container and then the truncated-text div
|
|
|
|
|
const container = link.closest('.text-container').querySelector('.truncated-text'); |
|
|
|
|
container.classList.toggle('full'); |
|
|
|
|
link.textContent = container.classList.contains('full') ? 'Less' : 'More'; |
|
|
|
|
link.setAttribute('aria-expanded', container.classList.contains('full')); |
|
|
|
|
|