Retrospring/app/javascript/retrospring/features/inbox/index.ts

15 lines
466 B
TypeScript
Raw Normal View History

2021-08-11 05:10:24 -07:00
import registerEvents from "retrospring/utilities/registerEvents";
import {reportEventHandler} from "./report";
export default (): void => {
const entries: NodeList = document.querySelectorAll('.inbox-entry:not(.js-initialized)');
entries.forEach((element: HTMLElement) => {
registerEvents([
{type: 'click', target: element.querySelector('[name=ib-report]'), handler: reportEventHandler}
]);
element.classList.add('js-initialized');
});
}