mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-31 04:02:12 +02:00
Port comment toggle functionality to TypeScript
This commit is contained in:
parent
0feb05828a
commit
da26bbc6c0
2 changed files with 7 additions and 1 deletions
|
@ -0,0 +1,6 @@
|
||||||
|
export function commentToggleHandler(event: Event): void {
|
||||||
|
const button = event.target as HTMLButtonElement;
|
||||||
|
const id = button.dataset.aId;
|
||||||
|
|
||||||
|
document.querySelector(`#ab-comments-section-${id}`).classList.toggle('d-none');
|
||||||
|
}
|
|
@ -35,6 +35,6 @@
|
||||||
= link_to(raw(t('views.answerbox.time', time: time_tooltip(a))), show_user_answer_path(a.user.screen_name, a.id), class: 'answerbox__permalink')
|
= link_to(raw(t('views.answerbox.time', time: time_tooltip(a))), show_user_answer_path(a.user.screen_name, a.id), class: 'answerbox__permalink')
|
||||||
.col-md-6.d-md-flex.answerbox__actions
|
.col-md-6.d-md-flex.answerbox__actions
|
||||||
= render 'answerbox/actions', a: a, display_all: display_all
|
= render 'answerbox/actions', a: a, display_all: display_all
|
||||||
.card-footer{ id: "ab-comments-section-#{a.id}", style: display_all.nil? ? 'display: none' : nil }
|
.card-footer{ id: "ab-comments-section-#{a.id}", class: display_all.nil? ? 'd-none' : nil }
|
||||||
%div{ id: "ab-smiles-#{a.id}" }= render 'answerbox/smiles', a: a
|
%div{ id: "ab-smiles-#{a.id}" }= render 'answerbox/smiles', a: a
|
||||||
%div{ id: "ab-comments-#{a.id}" }= render 'answerbox/comments', a: a
|
%div{ id: "ab-comments-#{a.id}" }= render 'answerbox/comments', a: a
|
||||||
|
|
Loading…
Reference in a new issue