Skip to content
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

[RFR] Infinite scroll: avoid to load multiple time at the same time #1322

Merged
merged 5 commits into from
Mar 16, 2017

Conversation

Kmaschta
Copy link
Contributor

@Kmaschta Kmaschta commented Mar 15, 2017

Fix #681
Supersedes #1068

  • Use the native window wheel event
  • Only load the page if we down scroll (we loaded the page even with the top scroll)
  • Avoid to load a page if it's currently already loading it
  • Load at least one more page

@Kmaschta Kmaschta mentioned this pull request Mar 15, 2017
@Kmaschta Kmaschta changed the title [WIP] Infinite scroll: avoid to load multiple time at the same time [RFR] Infinite scroll: avoid to load multiple time at the same time Mar 15, 2017
package.json Outdated
@@ -52,6 +52,7 @@
"babel-preset-stage-2": "^6.13.0",
"chai": "^3.3.0",
"css-loader": "^0.25.0",
"diff": "^3.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ are bad

Copy link
Contributor Author

@Kmaschta Kmaschta Mar 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even in dev deps ?

My opinion is:

  • ~ for client projects
  • ^ is OK for open-source

@@ -1,10 +1,14 @@
import angular from 'angular';

export default function maDatagridInfinitePagination($window, $document) {
const isDownScrolling = wheelEvent => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isScrollingDown ?

};

// Trigger the scroll at least once
// In this case, we'll avoid that a pagination of a few element (< 10)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to understand, can you rephrase this or have a longer explanation ?

@floo51 floo51 merged commit 664d950 into master Mar 16, 2017
@floo51 floo51 deleted the fix-infinite-scrolling branch March 16, 2017 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants