You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.1 KiB
JavaScript

document.addEventListener("DOMContentLoaded", function () {
const toggleButtons = document.querySelectorAll('.toggleReply');
toggleButtons.forEach(button => {
button.addEventListener('click', function () {
const replyContainer = this.closest('.replyContainer');
const reply = replyContainer.querySelector('.reply');
const arrowUp = replyContainer.querySelector('.arrowUp');
const arrowDown = replyContainer.querySelector('.arrowDown');
reply.classList.toggle('hidden');
if (reply.classList.contains('hidden')) {
arrowUp.classList.add('hidden');
arrowDown.classList.remove('hidden');
} else {
arrowUp.classList.remove('hidden');
arrowDown.classList.add('hidden');
}
if (!reply.classList.contains('hidden')) {
replyContainer.classList.add('shadow-md');
} else {
replyContainer.classList.remove('shadow-md');
}
});
});
});