Remove inbox entry options collapse

This commit is contained in:
Andreas Nedbal 2023-02-05 18:17:12 +01:00 committed by Andreas Nedbal
parent 52ae7fbb81
commit 83d386267a
2 changed files with 0 additions and 18 deletions

View File

@ -1,7 +1,6 @@
import registerEvents from 'utilities/registerEvents';
import { answerEntryHandler, answerEntryInputHandler } from './answer';
import { deleteEntryHandler } from './delete';
import optionsEntryHandler from './options';
import { reportEventHandler } from './report';
export default (): void => {
@ -9,7 +8,6 @@ export default (): void => {
{ type: 'click', target: 'button[name="ib-answer"]', handler: answerEntryHandler, global: true },
{ type: 'click', target: '[name="ib-destroy"]', handler: deleteEntryHandler, global: true },
{ type: 'click', target: '[name=ib-report]', handler: reportEventHandler, global: true },
{ type: 'click', target: 'button[name=ib-options]', handler: optionsEntryHandler, global: true },
{ type: 'keydown', target: 'textarea[name=ib-answer]', handler: answerEntryInputHandler, global: true }
]);
}

View File

@ -1,16 +0,0 @@
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');
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');
}
}