comments on turbolinks event handling
This commit is contained in:
parent
696864eacd
commit
5151b15c71
2 changed files with 4 additions and 4 deletions
|
@ -26,10 +26,6 @@
|
|||
const text = e.target.innerText;
|
||||
const { totalPages, nextPage, previousPage } = this.pageInfo;
|
||||
|
||||
/**
|
||||
the regex here is to read if the string coming in will become a valid number
|
||||
had issues with parsing using `+` because `typeof NaN === 'number'`
|
||||
*/
|
||||
if (text === SPREAD) {
|
||||
return;
|
||||
} else if (text === LAST) {
|
||||
|
|
|
@ -63,12 +63,16 @@
|
|||
window.removeEventListener('beforeunload', () => {});
|
||||
window.removeEventListener('focus', () => {});
|
||||
window.removeEventListener('blur', () => {});
|
||||
|
||||
// turbolinks event handler
|
||||
document.removeEventListener('page:fetch', () => {});
|
||||
};
|
||||
|
||||
window.addEventListener('beforeunload', removeTimeIntervals);
|
||||
window.addEventListener('focus', startIntervalLoops);
|
||||
window.addEventListener('blur', removeTimeIntervals);
|
||||
|
||||
// turbolinks event handler
|
||||
document.addEventListener('page:fetch', removeAll);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue