frankban / django-endless-pagination

This project is deprecated: please use https://github.com/shtalinberg/django-el-pagination
MIT License
251 stars 108 forks source link

How to avoid removing “page” parameter from URI? #71

Open slotix opened 10 years ago

slotix commented 10 years ago

I use Digg-style with activated ajax support for my project. The annoying thing that it hides parameter ?page=N from URI.

So if I, for example, go back from details page to the general list page it returns me to the first page instead of actual page=N where it comes from.

In case of AJAX deactivation it works as expected and passes "page" parameter to GET. But it disappears right after AJAX activation.

I've tried to change the string #103 at endless-pagination.js from

return false; to return true;

Page parameter is passed to URL properly, but it seems at the same time AJAX stopped working forced to reload the whole page when switching between pages.

slotix commented 10 years ago

Just added the following string to endless-pagination.js before string #103 return false; window.history.pushState(3, document.title, context.url);

Now it works as expected.