var startInfiniteScrolling = function() {
Start listening to the window's scroll event and decide when we are close enough to the end of the page before fetching the next set of items
var loadNextList = function() {
Function that checks whether the current scroll position is within a certain distance of the end of the page. If it is, we load the next set of results
var removeItems = function(items) {
Function called when items are removed from the list. This will fade the items out and hide them.
param {Object} items Array of jQuery elements or array of strings of ids that need to be removed. For the latter case, each of these string should correspond with a Dom element that has this string as an id.
var prependItems = function(items) {
Function called to prepend items to the list. This will be used when UI caching needs to be used
param {Object} items Array of items to be prepended
var renderList = function(data, prepend) {
Add a list of items to the current infinite scroll list.
param {Object} data List of items to add to the infinite scroll list
param {Object} prepend True when we want to prepend the new items to the list False when we want to append the new items to the list
var processList = function(data, prepend) {
Run the list of items to be added to a processor before pushing them through a template. The postProcessor will be given an array of items to be added to the infinite scroll. The plugin expects an array of items to come back from the postProcessor as well.
param {Object} data List of items to add to the infinite scroll list
param {Object} prepend True when we want to prepend the new items to the list False when we want to append the new items to the list
var loadResultList = function(initial) {
Retrieve the next set of results from the server
param {Object} initial Whether or not this is the initial set of results that's being loaded
var kill = function() {
Kill an instance of an infinite scroll object. This means the object will no longer respond to any events or functions
var showHideLoadingContainer = function(show) {
Show or hide the loading image
param {Object} show True when the loading image should be shown False when the loading image should be hidden
var setUpLoadingIcon = function() {
Create a div underneath the infinite scroll list that shows a loading image provided by the container when a new set of results is being loaded
var loadInitialList = function() {
Get the initial list of items to add to the list