Hello guys.

Some time it may be useful to control mentioned features (for example, when next set of results should start loading before user reached end of page, or close to that). I've seen that mentioned values are hardcoded into the file js/infinite-scroll.js. I attach a patch to allow editing mentioned values (and in future, others could be grouped there) and therefore, having following options:
Advanced options auto loading

Cheers.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

waspper created an issue. See original summary.

andypost’s picture

andypost’s picture

Status: Active » Needs review
andypost’s picture

Issue tags: +Needs tests

Also it needs update hook for existing installs

YurkinPark’s picture

StatusFileSize
new4.4 KB
new1.36 KB

I've changed type of new settings from text to number.

Also it needs update hook for existing installs

I don't see needs to provide updates for existing installs.

Status: Needs review » Needs work

The last submitted patch, 5: 2950901_5.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

andypost’s picture

You need to resave existing views to add defaults

YurkinPark’s picture

StatusFileSize
new4.42 KB
new606 bytes

Provided wrong config schema. Testing now, Will provide update next time.

YurkinPark’s picture

Status: Needs work » Needs review
YurkinPark’s picture

StatusFileSize
new18.51 KB
new13.32 KB

I've provided update and test for it. I guess, this is final state :)

Status: Needs review » Needs work

The last submitted patch, 10: 2950901_10.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

YurkinPark’s picture

StatusFileSize
new18.48 KB
new13.29 KB

One more time :)

YurkinPark’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 12: 2950901_12.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

YurkinPark’s picture

Status: Needs work » Needs review
StatusFileSize
new13.72 KB
new8.67 KB

One more

neslee canil pinto’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
YurkinPark’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests, -Needs reroll
StatusFileSize
new14.14 KB
nikitagupta’s picture

Status: Needs review » Fixed

Patch works fine.

YurkinPark’s picture

Status: Fixed » Needs review

"fixed" status used for closed issues (i guess) and can not be applied until patch is not applied

nikitagupta’s picture

Status: Needs review » Reviewed & tested by the community

Patch works fine.

jordanmagnuson’s picture

Issue tags: +Needs backport to D7

Great idea! Would love to see this functionality back-ported to D7 as well...

finex’s picture

Hi, thanks for the patch! It's very useful!

francis_nadal’s picture

hi,

I'm looking into applying this patch to our installed module but when I try to the patch seems skipping the files. I tried downloading the patch file and saved it in the module root folder but no luck. I also tried downloading it via curl.

$ git apply -v 2950901-17.patch
Skipped patch 'config/schema/views_infinite_scroll.schema.yml'.
Skipped patch 'js/infinite-scroll.js'.
Skipped patch 'src/Plugin/views/pager/InfiniteScroll.php'.
Skipped patch 'tests/fixtures/update/views.view.test_settings_updates.yml'.
Skipped patch 'tests/fixtures/update/views_infinite_scroll.scroll_settings.2950901.php'.
Skipped patch 'tests/src/Functional/Update/UpdateVisPagerSettingsTest.php'.
Skipped patch 'views_infinite_scroll.module'.
Skipped patch 'views_infinite_scroll.post_update.php'.

I also replaced my module from 8.x-1.7 to 8.x-1.x-dev. Hope I could get some help, thank you very much!
---
EDIT:

I just googled but if ever anyone will experience the same thing I did here's what I did to apply patch.

patch -p1 < 2950901-17.patch

it gave me a notification:
patching file config/schema/views_infinite_scroll.schema.yml
patching file js/infinite-scroll.js
Hunk #2 FAILED at 74.
1 out of 3 hunks FAILED -- saving rejects to file js/infinite-scroll.js.rej
patching file src/Plugin/views/pager/InfiniteScroll.php
Hunk #1 succeeded at 63 (offset 3 lines).
Hunk #2 succeeded at 135 (offset 10 lines).
patching file tests/fixtures/update/views.view.test_settings_updates.yml
patching file tests/fixtures/update/views_infinite_scroll.scroll_settings.2950901.php
patching file tests/src/Functional/Update/UpdateVisPagerSettingsTest.php
patching file views_infinite_scroll.module
patching file views_infinite_scroll.post_update.php

so I googled again and learned to just apply the hunk that failed manually. All is working now, thank you very much for this patch!

nicola85’s picture

StatusFileSize
new20.74 KB
luksak’s picture

StatusFileSize
new4.82 KB

Here is a re-roll of #17.

#24 Had no comment on changes and included unneeded files.

glynster’s picture

This works well when you are combining with other 3rd party scripts, such as scroll reveal and isotope.

bardiuk’s picture

This thread is unclear mess (
Why is it so hard (

anybody’s picture

Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

Is this still an issue with 2.0.x? If yes, please update the version and set the status active again with clear steps or (best) with a test showing what's broken.

2.0.x is the active development branch.

If nobody replies, we should assume this is fixed and close this issue outdated.

Thanks!

andypost’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
Status: Postponed (maintainer needs more info) » Needs work
Issue tags: +Needs reroll

The issue still remain as 2.x also hard-coding both settings https://git.drupalcode.org/project/views_infinite_scroll/-/blob/2.0.x/js...

patch just needs re-roll

YurkinPark’s picture

Status: Needs work » Needs review
StatusFileSize
new4.94 KB

Rerolled for 2.0.x-dev branch

anybody’s picture

Thanks @YurkinPark! Cool :)
I just thought, if we should combine this with #3329060: Add settings to additionally focus on a new appearing element would that make sense?

YurkinPark’s picture

StatusFileSize
new5.42 KB
new360 bytes

@Anybody i think better to keep independent tickets because here we solving issue related to threshold and delay, in #3329060: Add settings to additionally focus on a new appearing element - another stuff.

anybody’s picture

Thanks @YurkinPark okay let's keep them separate. Perhaps it would speed up, if you'd provide the patch as MR, so the mainainer (I'm not) can review merge it easier?

anybody’s picture

Issue tags: -Needs reroll

@Grevil would you mind to review this and take it over the finish line?

anybody’s picture

GBlicharz made their first commit to this issue’s fork.

gblicharz’s picture

Minor update to the #33 patch to fix the error in InfiniteScrollTest.php

gblicharz’s picture

StatusFileSize
new0 bytes

Minor update to the #33 patch to fix the error in InfiniteScrollTest.php

gblicharz’s picture

StatusFileSize
new5.43 KB

Sorry for the bad patch attempts. Longtime developer, but I have never updated a Drupal module/patch before! Hopefully the third time is the charm! It is just a minor update to #2950901-33: Allow setting scroll threshold and delay