comments on turbolinks event handling

This commit is contained in:
Regis 2016-12-15 10:04:26 -07:00
parent 696864eacd
commit 5151b15c71
2 changed files with 4 additions and 4 deletions

View file

@ -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) {

View file

@ -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);
}
};