Hello. One quick note to point out on the module. Since we are getting new content via AJAX, once it is loaded we should also call Drupal.attachBehaviors() to re-attach any javascript effects to this newly loaded content. For example, I maintain the Hover Preview module, which adds a javascript hover effect to images. The hover isn't applied to the newly loaded AJAX content.
Here's a reference:
http://drupal.org/node/114774#javascript-behaviors
Here's the relevant text:
Code should also be updated if it adds AJAX/AHAH loaded content. Developers implementing AHAH/AJAX in their solutions should call Drupal.attachBehaviors() after new page content has been loaded, feeding in an element to be processed, in order to attach all behaviors to the new content. Examples:
$(targetElt).html(response.data);
Drupal.attachBehaviors(targetElt);
or
var newContent = $(response.data).appendTo(elt);
Drupal.attachBehaviors(newContent[0]);
Comments
Comment #1
rjbrown99 commentedIt looks like the load: function of $.autopager in views_infinite_scroll.js is a good place to do that since it gets called after the content loads per their documentation:
http://lagoscript.org/jquery/autopager/documentation
I haven't tested it yet, just thinking out loud.
EDIT: Hmm, that isn't working so well - it keeps re-loading page 1 of the content every time you hit the fold to load new stuff.
Comment #2
rjbrown99 commentedPerhaps something similar to this so infinite scroll isn't called multiple times when behaviors are attached:
http://www.opensourcery.com/blog/jonathan-hedstrom/simple-timed-events-j...
... with a call to Drupal.attachBehaviors(content_selector); inside the load: of .autopager per #1.
Comment #3
Remon commentedConfirmed! thanks for the bug report.
Comment #4
Remon commentedFixed