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();
|
start();
|
||||||
document.addEventListener('turbolinks:load', initAnswerbox);
|
document.addEventListener('turbolinks:load', initAnswerbox);
|
||||||
document.addEventListener('turbolinks:load', initInbox);
|
document.addEventListener('DOMContentLoaded', initInbox);
|
||||||
document.addEventListener('DOMContentLoaded', initUser);
|
document.addEventListener('DOMContentLoaded', initUser);
|
||||||
document.addEventListener('turbolinks:load', initSettings);
|
document.addEventListener('turbolinks:load', initSettings);
|
||||||
document.addEventListener('DOMContentLoaded', initLists);
|
document.addEventListener('DOMContentLoaded', initLists);
|
|
@ -6,10 +6,10 @@ import { generateQuestionHandler } from './generate';
|
||||||
|
|
||||||
export default (): void => {
|
export default (): void => {
|
||||||
registerEvents([
|
registerEvents([
|
||||||
{ type: 'click', target: document.querySelector('#ib-generate-question'), handler: generateQuestionHandler },
|
{ type: 'click', target: '#ib-generate-question', handler: generateQuestionHandler, global: true },
|
||||||
{ type: 'click', target: document.querySelector('#ib-delete-all'), handler: deleteAllQuestionsHandler },
|
{ type: 'click', target: '#ib-delete-all', handler: deleteAllQuestionsHandler, global: true },
|
||||||
{ type: 'click', target: document.querySelector('#ib-delete-all-author'), handler: deleteAllAuthorQuestionsHandler },
|
{ type: 'click', target: '#ib-delete-all-author', handler: deleteAllAuthorQuestionsHandler, global: true },
|
||||||
{ type: 'submit', target: document.querySelector('#author-form'), handler: authorSearchHandler }
|
{ type: 'submit', target: '#author-form', handler: authorSearchHandler, global: true }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
registerInboxEntryEvents();
|
registerInboxEntryEvents();
|
||||||
|
|
Loading…
Reference in New Issue