Retrospring/app/javascript/retrospring/features/inbox/entry/options.ts

17 lines
590 B
TypeScript
Raw Normal View History

export default function optionsEntryHandler(event: Event): void {
const button = event.target as HTMLElement;
const inboxId = button.dataset.ibId;
const options = document.querySelector(`#ib-options-${inboxId}`);
options.classList.toggle('d-none');
2023-01-06 08:35:49 -08:00
const buttonIcon = button.getElementsByTagName('i')[0];
if (buttonIcon.classList.contains('fa-chevron-down')) {
buttonIcon.classList.remove('fa-chevron-down');
buttonIcon.classList.add('fa-chevron-up');
} else {
buttonIcon.classList.remove('fa-chevron-up');
buttonIcon.classList.add('fa-chevron-down');
}
}