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

Infinite scroll for LoadMore component #403

Open
AlexFrazer opened this issue Dec 22, 2015 · 3 comments
Open

Infinite scroll for LoadMore component #403

AlexFrazer opened this issue Dec 22, 2015 · 3 comments

Comments

@AlexFrazer
Copy link

I am trying to implement some simple infinite scroll. However the newer version seems to be missing something the older version had.

infiniteScroll() {
    const interval = 5;
    let size = $(this.firstNode()).parent().innerHeight();
    let item = this.$(this.find('.list #list-content')).outerHeight();
    let pageLimit = Math.ceil(((size / item) / interval)) * interval;  // nearest 5
    let numberLoaded = this.index.getComponentDict().get('currentCount');

    this.index.getComponentMethods().loadMore(pageLimit - numberLoaded);
}

Is there an easier way to do this? If not, want a PR to add it?

@matteodem
Copy link
Owner

yeah sure, I think a parameter on the LoadMore button might be the way to go.

{{> EasySearch.LoadMore infiniteScroll=true }}, maybe?

@annemarie35
Copy link

Up, would be very useful ^^

@matteodem
Copy link
Owner

Feel free to add PR's if you want to contribute to this package.

@matteodem matteodem changed the title Suggestion: easier way to change page limit. Infinite scorll for LoadMore component Mar 29, 2016
@matteodem matteodem changed the title Infinite scorll for LoadMore component Infinite scroll for LoadMore component Mar 29, 2016
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

3 participants