Retrospring/app/javascript/retrospring/features/moderation/comment/toggle.ts

6 lines
227 B
TypeScript

export function entryCommentToggle(event: Event): void {
const button = event.target as HTMLButtonElement;
const id = button.dataset.id;
document.querySelector(`#mod-comments-section-${id}`).classList.toggle('d-none');
}