I changed the module to support a different jQuery Infinite Scroll library. I found the following library that adds a lot more features to the current library: https://github.com/webcreate/infinite-ajax-scroll
The library should as git clone or unpacked in the libraries directory in 'infinite-ajax-scroll' so for example: sites/all/libraries/infinite-ajax-scroll. The module expects the library in the dist directory.

With this the following features are added:

Almost all the settings provided by the library can be set using the settings form of the pager.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

h3rj4n’s picture

h3rj4n’s picture

Fixed some bugs and typo's.

swim’s picture

Issue summary: View changes
Status: Active » Needs review

This is a fantastic idea +1.

Paul Lomax’s picture

This is awsome, works flawlessly so far. RTBC +1

I think the problem is to switch it over would break a lot of peoples sites in a straight upgrade, but this is a huge improvement so probably worth it in the long run.

hefox’s picture

Status: Needs review » Needs work

The loading gif is broken

Not that this is for the 1.x version; there's now a 2.x

hefox’s picture

fixing image bath to use base_url instead of url(, which gets the current language added and breaks. Also removing the part about only supporting one per page -- I think that's an outdated requirment?

hefox’s picture

Status: Needs work » Needs review
FileSize
19.87 KB

It's positioning the load more items after the last views-row, which is a hassle for themeing, and mean user can't effect where's it's placed, so small patch to add it after the pager.

hefox’s picture

1) drupal.attachBehaviors wasn't being called
2) all the stuff about changing the path to not use ajax isn't relavent for this js library, as it works without needing to do that.

Lukas von Blarer’s picture

Oh wow! Finally this module gets the threshold feature back! This was a big problem for a few websites I created. Lets get this committed!

vintorg’s picture

I applied the patch in #8. I'm getting the JS error:

Uncaught ReferenceError: IASCallbacks is not defined

pacome’s picture

i'm also getting this error : Uncaught TypeError: Cannot call method 'Deferred' of undefined in jquery-ias.min.js

hefox’s picture

Using the 1.x version of the library?

pacome’s picture

Oeps !
Thanks hefox, i forgot to download that one..
No more errors with 1.x library
Thanks for the great work !

pacome’s picture

a quick question : i was hoping the use of this new library could solve the issue here https://drupal.org/node/2164235, where javascript included in the view get stripped after the first page, but it doesn't seem to work (all the rest works perfectly).

Is that a bug that should be fixed with the patches up here ? (just trying to figure out if i'm missing something here or not ;) )
thx

vintorg’s picture

The new library didn't work for me when I tried it. I had to use the original version.

I have the duplicating rows problem at the end of my view scroll, so I don't know what solution to try with that.

hefox’s picture

adding a filter_xss and t around the trigger text

"didn't work for me" isn't really a good bug report :( unless you mean the bug was that it was causing duplicates? unclear comment

vintorg’s picture

I ended up figuring out my issue. I'm using Responsive Grid with Views, and the Views Infinite Scroll module doesn't support it. I'm using some jQuery to hold it together right now, but after I finish this project, I'll go back and submit a patch for that support, if one doesn't exist at that time.

hefox’s picture

Quick reroll to remove div from selectors as they are not needed and limit the markup that can be used when themeing the view.

hefox’s picture

Reroll with correct files

jmdall’s picture

Hi,

I've added an option in the view infinite scroll options, to set the scrollContainer :
By default, scroll events are listened from the $(window) object. You can use this setting to specify a custom container, for example a div with overflow.

claudiu.cristea’s picture

@jmdall, can you post an interdiff too? It's so hard to track changes

jmdall’s picture

Something went wrong with my last patch (corrupted), here's a new one.

I'll try to do an interdiff.

jmdall’s picture

FileSize
1.88 KB

Here's the interdiff of my last patch in #22

Ok sorry again, it's my first time/patch/interdiff and the interdiff is missing some changes...

hefox’s picture

Status: Needs review » Needs work
+++ b/js/views_infinite_scroll.js
@@ -11,6 +11,11 @@
+          } else {

This is incorrect syntex as far as coding standards go, else should be on it's own line. Other than that looks fine

jmdall’s picture

Ok, new patch working correctly respecting coding standard and with interdiff with #19.

Like I've said on #20, it add the possibility to set the scrollContainer

Thanks hefox.

jmdall’s picture

Adding missing line ending at the end of the patch that could cause troubles to apply.

jmdall’s picture

claudiu.cristea’s picture

Applying the patch from #26 gives next error

Notice: Undefined index: scroll_container in theme_views_infinite_scroll_pager() (line 17 of sites/all/modules/views_infinite_scroll/theme/views_infinite_scroll_theme.inc).

So, it doesn't work having no scroll container

jmdall’s picture

FileSize
17 KB

Here's a new patch that add a check to fix this Notice, even though I'm surprised that it doesn't work with this notice. I couldn't reproduce with no scroll container set.

claudiu.cristea’s picture

What version of PHP?

jmdall’s picture

Version 5.4.4

caminadaf’s picture

The notice reported happened because you had to set a default for scroll_container on option_definition, or else this default would not be set and would return NULL. You probably didn't get this error because you had already set it once, so the variable $options['ias]['scroll_container'] was already set.

I fixed this issue and also updated the patch with the current HEAD for branch 7.x-1.x. Also did some minor coding standard fixes.

larjohn’s picture

I am not able to apply this patch... either with git or with patch. What release are they aimed at?

hackwater’s picture

@larjohn, I had to manually apply the .info file changes and remove that part of the patch to get it to apply to the 7.x-1.x-dev release; the patch applies cleanly against the 7.x-1.x Git branch for me (git clone --branch 7.x-1.x http://git.drupal.org/project/views_infinite_scroll.git if you haven't cloned the repo already, or git checkout -b 7.x-1.x --track origin/7.x-1.x to switch to the branch in your existing repo).

caminadaf’s picture

@hackwater and larjohn, did you manage to apply this patch? If so, can we move this to Review?

hackwater’s picture

@caminadaf I applied it via the method I outlined in #34, and it's working on a client site, but it's very lightly tested.

ron_s’s picture

This patch needs to be reworked as an option, rather than a replacement, for the existing library.

I'm not sure if anyone has realized this, but the library used in this patch is only free for personal use. It cannot be used on any website that sells anything without purchasing a license:

https://infiniteajaxscroll.com/download.html

When do I need a commercial license?
You need a commercial license if you want to use this plugin on a website that sells anything.

Honza Pobořil’s picture

Status: Needs work » Closed (outdated)

7.x-1.x will receive no work. Migrate to 7.x-2.x.