Use proper events for global event handlers
This commit is contained in:
parent
36acd25395
commit
f7e4fc76cb
|
@ -7,7 +7,7 @@ import initLists from 'retrospring/features/lists';
|
|||
|
||||
start();
|
||||
document.addEventListener('turbolinks:load', initAnswerbox);
|
||||
document.addEventListener('turbolinks:load', initInbox);
|
||||
document.addEventListener('DOMContentLoaded', initInbox);
|
||||
document.addEventListener('DOMContentLoaded', initUser);
|
||||
document.addEventListener('turbolinks:load', initSettings);
|
||||
document.addEventListener('DOMContentLoaded', initLists);
|
|
@ -6,10 +6,10 @@ import { generateQuestionHandler } from './generate';
|
|||
|
||||
export default (): void => {
|
||||
registerEvents([
|
||||
{ type: 'click', target: document.querySelector('#ib-generate-question'), handler: generateQuestionHandler },
|
||||
{ type: 'click', target: document.querySelector('#ib-delete-all'), handler: deleteAllQuestionsHandler },
|
||||
{ type: 'click', target: document.querySelector('#ib-delete-all-author'), handler: deleteAllAuthorQuestionsHandler },
|
||||
{ type: 'submit', target: document.querySelector('#author-form'), handler: authorSearchHandler }
|
||||
{ type: 'click', target: '#ib-generate-question', handler: generateQuestionHandler, global: true },
|
||||
{ type: 'click', target: '#ib-delete-all', handler: deleteAllQuestionsHandler, global: true },
|
||||
{ type: 'click', target: '#ib-delete-all-author', handler: deleteAllAuthorQuestionsHandler, global: true },
|
||||
{ type: 'submit', target: '#author-form', handler: authorSearchHandler, global: true }
|
||||
]);
|
||||
|
||||
registerInboxEntryEvents();
|
||||
|
|
Loading…
Reference in New Issue