diff --git a/app/javascript/packs/application.ts b/app/javascript/packs/application.ts index edcdba3c..3fa1a7a6 100644 --- a/app/javascript/packs/application.ts +++ b/app/javascript/packs/application.ts @@ -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); \ No newline at end of file +document.addEventListener('DOMContentLoaded', initUser); +document.addEventListener('DOMContentLoaded', initLists); \ No newline at end of file diff --git a/app/javascript/retrospring/features/lists/index.ts b/app/javascript/retrospring/features/lists/index.ts new file mode 100644 index 00000000..4bb9d71f --- /dev/null +++ b/app/javascript/retrospring/features/lists/index.ts @@ -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); +} \ No newline at end of file