Needs popstate option to resolve history issue #170
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If you use whenDOMReady and try hitting the back button, it won't fire using success | complete. To get whenDOMReady to fire when navigating with history (back | forward), you need to attach an event listener to popstate. (i.e. document.addEventListener('pjax:popstate', function(){ //do stuff });
If you alter the pjax library within the function that handles popstate at about line 53 with:
trigger(document,"pjax:popstate", state.options)
Then you will be able to add in your custom code:
document.addEventListener('pjax:popstate', whenDOMReady)
It will solve the DOM ready, etc... not firing on history issue.
I would suggest adding the pjax:popstate option...
What's wrong with the success or complete events?
The
popstatehandler callsloadUrl()to load the page, just like when you click a new link. Further down the callstack, thepjax:successandpjax:completeevents should be triggered.I don't understand the issue. Popstate should trigger the success and complete events. Did you try it and it wasn't triggered?
Please post your code that reproduces the issue, so I can try to debug it.
All I can tell you, is that it does not always trigger with success/complete and reliably works with popstate. Thank you for your help, but I have resolved my issue.