sourcebitsllc / chocolatechip-ui

Mobile Web App Framework
www.chocolatechip-ui.com
MIT License
617 stars 88 forks source link

UIPaging: Support dynamic sections & infinite loop #31

Closed mattgoldspink closed 10 years ago

mattgoldspink commented 10 years ago

My app dynamically adds new "section"s when search results are returned, but unfortunately the current implementation of UIPaging counts the number of sections once on creation, which means the paging buttons don't allow me to navigate through newly added sections.

In addition as the number of sections grows it can be a bit of pain to go all the way back to the start, so I added a looping capability to be able to page through all the "section"s infinitely. This also improves the usability I think because it was never clear when you were at the end of the pages - that was feedback from some of our users about the default implementation, I'm sure it could be improved with some better design, but in the end the infinite paging seemed to be popular to stick.