2023-03-05 08:29:38 -08:00
|
|
|
export function commentHotkeyHandler(event: Event): void {
|
|
|
|
const button = event.target as HTMLButtonElement;
|
|
|
|
const id = button.dataset.aId;
|
2023-10-14 23:23:11 -07:00
|
|
|
const answerbox = button.closest('.answerbox');
|
2023-03-05 08:29:38 -08:00
|
|
|
|
2023-10-14 23:23:11 -07:00
|
|
|
if (answerbox !== null) {
|
|
|
|
answerbox.querySelector(`#ab-comments-section-${id}`).classList.toggle('d-none');
|
|
|
|
answerbox.querySelector<HTMLElement>(`[name="ab-comment-new"][data-a-id="${id}"]`).focus();
|
|
|
|
}
|
2023-03-05 08:29:38 -08:00
|
|
|
}
|