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

15 lines
458 B
TypeScript
Raw Normal View History

import registerEvents from 'utilities/registerEvents';
import { reportEventHandler } from './report';
2021-08-11 05:10:24 -07:00
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 }
2021-08-11 05:10:24 -07:00
]);
element.classList.add('js-initialized');
});
}