Retrospring/app/javascript/retrospring/features/answerbox/comment/index.ts

19 lines
1.1 KiB
TypeScript
Raw Normal View History

import registerEvents from "retrospring/utilities/registerEvents";
2022-01-08 15:54:11 -08:00
import { commentDestroyHandler } from "./destroy";
import {commentComposeEnd, commentComposeStart, commentCreateHandler} from "./new";
2022-01-08 15:54:11 -08:00
import { commentReportHandler } from "./report";
import { commentSmileHandler } from "./smile";
import { commentToggleHandler } from "./toggle";
export default (): void => {
registerEvents([
{ type: 'click', target: '[name=ab-comments]', handler: commentToggleHandler, global: true },
{ type: 'click', target: '[name=ab-smile-comment]', handler: commentSmileHandler, global: true },
{ type: 'click', target: '[data-action=ab-comment-report]', handler: commentReportHandler, global: true },
{ type: 'click', target: '[data-action=ab-comment-destroy]', handler: commentDestroyHandler, global: true },
{ type: 'compositionstart', target: '[name=ab-comment-new]', handler: commentComposeStart, global: true },
{ type: 'compositionend', target: '[name=ab-comment-new]', handler: commentComposeEnd, global: true },
2023-03-07 08:56:39 -08:00
{ type: 'keydown', target: '[name=ab-comment-new]', handler: commentCreateHandler, global: true }
2022-01-08 15:54:11 -08:00
]);
}