vzctl / RationalReads

5 stars 1 forks source link

Always end up on first page of stories when clicking "Back" #2

Open abulgatz opened 9 years ago

abulgatz commented 9 years ago

If I'm on the 2nd, 3rd, etc page of stories on any index view, after clicking on a story and clicking "back" in the browser, I always end up back on the 1st page of results.

I assume that this is a Backbone issue. I wouldn't mind if the app just refreshed the page when showing me the next page of results. I'm not a huge fan of javascript pagination, but the most important part is to at least be able to go back to the correct page number.

Amit-P-Amin commented 9 years ago

Yeah... this is an issue I did not consider at all. Hm... So there's a 0% chance that I'll move the pagination from backbone to rails - that would require an entire re-engineering of the app. But I know how I can fix this problem. Won't be easy, but is certainly doable. Thanks for bringing this to my attention!

Is there some other reason you aren't a huge fan of javascript pagination as well?

abulgatz commented 9 years ago

Because I oftentimes run into problems like this one.

The browser (and they are all pretty consistent) gives you a lot of functionality, and because it is built into the browser, it is consistent across websites. If a website don't use javascript for pagination, I can be guaranteed that when I click "back", I will go the the exact position on the last page that I was on. Oftentimes with javascript pagination, I will at least lose the position on the page, or in this case, the entire page.

A couple of other problems with this specific implementation:

You aren't changing the URL at all when switching between pages, so I can't easily jump between pages by using the URL, or see which page I'm on without scrolling to the bottom of the page

You also don't have any animation to show that the page has actually refreshed when moving between pages (such as flashing to white) that would distinguish between the page refreshing and simply scrolling to the top of the page.

nevinera commented 9 years ago

If you ever decide to 're-engineer the app', poke me - I'd love to help with that ;-)