vojtech-dobes / history.nette.ajax.js

Adds History API support to nette.ajax.js addon!
30 stars 27 forks source link

Fixed buggy behavior when distinguishing the initial pop #4

Closed jiripudil closed 10 years ago

jiripudil commented 10 years ago

The fix to vojtech-dobes/nette.ajax.js#73 has been missing a negation. Reported in vojtech-dobes/nette.ajax.js#82

jiripudil commented 10 years ago

I dug into it a bit more. Obviously Safari is the last browser to trigger popstate on initial page load and while the negation seems to fix it for Safari, it introduces somewhat buggy behaviour in other browsers (e.g. changing history once and then immediately navigating back is mistaken for the initial pop).

I came up with a solution to set popped to true in the success event as then we can be sure that the next pop won't be the initial one. What do you think?

thorewi commented 10 years ago

@jiripudil with your fix it's working pretty fine for me - are you still experiencing issues described in your second comment?

jiripudil commented 10 years ago

No issues whatsoever, this seems to fix it for good.

thorewi commented 10 years ago

@vojtech-dobes is there a possibility to merge it?

vojtech-dobes commented 10 years ago

Thanks guys, I trust your investigation and hopefully whole initial-pop-bug will become history :).