history.nette.ajax.js
history.nette.ajax.js copied to clipboard
Fixing condition in popstate event handler
After merging #33, the popstate history stopped working at all. I believe the reason is that e.event
is always undefined on this line. e
is jQuery Event Object, which does not contain property event
. The proposed and linked solution on stack overflow however uses native JS event. Therefore, the correct condition should be using e.originalEvent.state
:
...
if (initialPop || !e.originalEvent.state) {
...
:+1: Just bumped into same issue and this fix works.