Setup lists feature in TypeScript

This commit is contained in:
Andreas Nedbal 2021-12-28 21:12:33 +01:00
parent 4008d2fd05
commit 542cdd8b9a
2 changed files with 14 additions and 1 deletions

View File

@ -2,8 +2,10 @@ import start from 'retrospring/common';
import initAnswerbox from 'retrospring/features/answerbox/index';
import initInbox from 'retrospring/features/inbox/index';
import initUser from 'retrospring/features/user';
import initLists from 'retrospring/features/lists';
start();
document.addEventListener('turbolinks:load', initAnswerbox);
document.addEventListener('turbolinks:load', initInbox);
document.addEventListener('DOMContentLoaded', initUser);
document.addEventListener('DOMContentLoaded', initUser);
document.addEventListener('DOMContentLoaded', initLists);

View File

@ -0,0 +1,11 @@
import { on } from 'retrospring/utilities/on';
import { createListHandler, createListInputHandler } from './create';
import { destroyListHandler } from './destroy';
import { listMembershipHandler } from './membership';
export default (): void => {
on('click', 'input[type=checkbox][name=gm-list-check]', listMembershipHandler);
on('click', 'button#create-list', createListHandler);
on('click', 'a#delete-list', destroyListHandler);
on('keyup', 'input#new-list-name', createListInputHandler);
}