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

Javascript refactoring #1

Closed
frankban opened this issue Oct 10, 2012 · 2 comments
Closed

Javascript refactoring #1

frankban opened this issue Oct 10, 2012 · 2 comments

Comments

@frankban
Copy link
Owner

Must:

  • use $.endlessPaginate syntax;
  • handle onScroll as an option;
  • add ability to attach callbacks;
  • use selectors to decide what elements need to be paginated, and how;
  • maintain backward compatibility.
@ghost ghost assigned frankban Oct 10, 2012
@frankban
Copy link
Owner Author

Also avoid on scroll duplicate calls.
marcofucci said in google code:

With some browsers, you might have duplicate ajax calls triggered if you're using the twitter approach.
The problem also appears if an ajax request takes several seconds.

To avoid that, just check if a previous call is in progress:

endless.js

Add:

if (loading.is(':visible')) {
return;
};

after:

var container = $(this).closest(".endless_container");
var loading = container.find(".endless_loading");

@frankban
Copy link
Owner Author

JavaScript refactoring done and documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant