/(function ($) { "use strict"; var $window = $(window); // The threshold for how far to the bottom you should reach before reloading. var scroll_threshold = 200; var vis_index = 0; /** * Insert a views infinite scroll view into the document after AJAX. * * @param {object} $new_view The new view coming from the server. */ $.fn.infiniteScrollInsertView = function ($new_view) { var $existing_view = this; var $existing_content = $existing_view.find('.view-content').children(); $new_view.find('.view-content').prepend($existing_content); $existing_view.replaceWith($new_view); $(document).trigger('infiniteScrollComplete', [$new_view, $existing_content]); }; /** * Handle the automatic paging based on the scroll amount. */ Drupal.behaviors.views_infinite_scroll_automatic = { attach : function(context, settings) { var settings = settings.views_infinite_scroll; var loadingImg = '