webcreate/infinite-ajax-scroll — pull request #153 by antoinekociuba (2014-07-23 12:49:31+00:00)
Title: Implementation of a 'reload' method (extremely useful to rebind an updated DOM)

Sometimes, DOM can be updated by external actions/scripts (especially the items container).

It results that the infinite scroll is not working anymore, due to an obsolete binded DOM in getLastItem() method. It results the following incorrect calculation in getScrollThreshold() method:

$lastElement.offset().top will always equal 0.
$lastElement.height() will always equal 0.
currentScrollOffset >= scrollThreshold will never happen in scrollHandler() method.

By using the new reload() method after a DOM change, we redefine items container and calculations are back to normal.