With this patch you will get trigger ajax load on scroll percentage threshold rather than random scroll
AND we offer 'show more' button before percentage threshold.

Best of both worlds.

see patch 1

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joseph.olstad created an issue. See original summary.

joseph.olstad’s picture

With this patch, the ajax load behaves more naturally rather than simply loading on any scroll it loads when you've attained the percentage threshold.

This patch is designed for the 7.x-2.x release, it may also work on 8.x however I haven't tested 8.x yet.

joseph.olstad’s picture

'percent limit' is actually what I called it in the code.

Prior to this patch the scroll threshold didn't seem to do much of anything. Now the percent limit kicks in and we display the "show more" button until the percent limit is reached, at that point the ajax call is made and the loading... ajax loading image shows up as expected.

joseph.olstad’s picture

Version: 7.x-2.x-dev » 8.x-1.x-dev
FileSize
802 bytes

Here's an 8x patch, haven't tested it.

joseph.olstad’s picture

Patch #2 is the 7x patch, its working well for us
Patch #4 is the 8x patch, haven't tested it, have no idea if it works or not

Sam152’s picture

Version: 8.x-1.x-dev » 7.x-2.x-dev
Status: Needs review » Postponed (maintainer needs more info)

I don't understand why we need this? What kind of advantage is a percentage giving us, especially given it has to be adjusted manually based on how tall the document is?

There are also coding standard issues and uncached calls to $(document).

joseph.olstad’s picture

Sam152, the idea is to be able to scroll closer down to the bottom of the screen before the actual ajax call 'fires' , thats why the %'age

Sam152’s picture

The pixel based offset was relative to the pager, which would be the bottom of the view. If we wanted to scroll closer to the bottom of the view, we could just reduce the pixel scroll threshold.

Leaving as postponed. The extra code and complexity in this case isn't worth what this feature is offering.

andypost’s picture

I bet it could be closed as duplicate of #2950901: Allow setting scroll threshold and delay

it means you can configure and even override threshold runtime