Skip to content

Adding prefill logic to infiniteScrollHelper #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10.2.1
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ _(number)_ The starting page count that the plugin will increment each time the
### triggerInitialLoad ###
_(boolean)_ Whether or not the plugin should make an initial call to the `loadMore` callback. This can be set to `true` if, for instance, you need to load the initial content asynchronously on page load.

### prefill ###
_(boolean)_ Whether or not the plugin will attempt to load data until end of the visible scroll area. The default is false.

Methods
-------
Expand Down Expand Up @@ -108,6 +110,9 @@ Dependencies

Changelog
---------
### 1.2.5
* Added prefill support

### 1.2.4
* Fixed issue where loading class would not be removed after calling the done callback synchronously.
* Removed jQuery plugin repo JSON file.
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-infinite-scroll-helper",
"version": "1.2.4",
"version": "1.2.5",
"authors": [
"Ryan Ogden <[email protected]>"
],
Expand Down
2 changes: 1 addition & 1 deletion compositor.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"repo": "jquery-infinite-scroll-helper"
}
],
"text": "v1.2.4",
"text": "v1.2.5",
"backgroundImage": "",
"links": [],
"image": ""
Expand Down
3 changes: 3 additions & 0 deletions infinite-scroll-helper.jquery.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "infinite-scroll-helper"
}
10 changes: 9 additions & 1 deletion jquery.infinite-scroll-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@
* the initial content asynchronously on page load
* @type {boolean}
*/
triggerInitialLoad: false
triggerInitialLoad: false,

/**
* Whether or not the plugin will attempt to load data until end of the visible scroll area
*/
prefill: false
};

/*-------------------------------------------- */
Expand Down Expand Up @@ -278,6 +283,9 @@
this.loading = false;
this.$loadingClassTarget.removeClass(this.options.loadingClass);
!this.destroyed && this._addListeners();
if (this.options.prefill && this._shouldTriggerLoad()) {
this._handleScroll();
}
};

/*-------------------------------------------- */
Expand Down
2 changes: 1 addition & 1 deletion jquery.infinite-scroll-helper.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-infinite-scroll-helper",
"version": "1.2.4",
"version": "1.2.5",
"description": "A lightweight implementation of the infinite scroll mechanic. By providing two essential callbacks, loadMore and doneLoading, the jQuery Infinite Scroll Helper plugin makes it a breeze to add infinite scrolling functionality to your page.",
"keywords": [
"jquery",
Expand Down