vojtech-dobes / history.nette.ajax.js

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

client-side: fixed initial popstate callback being called on page load in Safari #33

Closed ne0-cz closed 7 years ago

ne0-cz commented 8 years ago

This fixes https://github.com/vojtech-dobes/history.nette.ajax.js/issues/29 based on http://stackoverflow.com/a/15897177/2278701

zipper commented 8 years ago

Thank you! It also fixes bug when cache is disabled and popstate is trigged by url hash change (eg. click on link to document anchor). No ajax request should be made in this case.

zipper commented 7 years ago

The already merged solution brings actually causes, that back button is never processed and snippets are never updated from history. It does not depend on cache being on/off. The e.state in popstate handler is always undefined. Anyone has a same problem?

EDIT: Shouldn't it be e.originalEvent.state in the condition? Since e is jQuery Event Object and according to documentation, it does not contain event property at all.