brianhadaway/iOSList — pull request #5 by asross (2014-10-14 20:45:37+00:00)
Title: add `refreshElements` function to handle added or removed elements

This addresses https://github.com/brianhadaway/iOSList/issues/4.

My problem was that I wanted to use iOSList with an infinite scroll plugin, but when I scrolled to newly added section headers, they didn't push the old headers away. Re-calling `$wrapperElement.ioslist()` didn't work because the initialization process isn't idempotent, but the only thing that matters is the `elems` variable, so it seemed simplest to add a function to refresh it.

I also made `IosList` accessible to `window` (see the second commit message), because otherwise I'm not sure how to invoke `refreshElements` from outside its file. I'd be open to adding some kind of listener instead or any other solution.