Skip to content

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

Merged
floo51 merged 5 commits intomasterfrom
fix-infinite-scrolling
Mar 16, 2017
Merged

[RFR] Infinite scroll: avoid to load multiple time at the same time#1322
floo51 merged 5 commits intomasterfrom
fix-infinite-scrolling

Conversation

@Kmaschta
Copy link
Copy Markdown
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
@Kmaschta Kmaschta force-pushed the fix-infinite-scrolling branch from 9b0cec7 to d809f5a Compare March 15, 2017 17:31
package.json Outdated
"babel-preset-stage-2": "^6.13.0",
"chai": "^3.3.0",
"css-loader": "^0.25.0",
"diff": "^3.2.0",
Copy link
Copy Markdown
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
Copy Markdown
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

import angular from 'angular';

export default function maDatagridInfinitePagination($window, $document) {
const isDownScrolling = wheelEvent => {
Copy link
Copy Markdown
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
Copy Markdown
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