meteor-easy-search icon indicating copy to clipboard operation
meteor-easy-search copied to clipboard

Infinite scroll for LoadMore component

Open AlexFrazer opened this issue 9 years ago • 3 comments

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?

AlexFrazer avatar Dec 22 '15 16:12 AlexFrazer

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

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

matteodem avatar Dec 23 '15 15:12 matteodem

Up, would be very useful ^^

annemarie35 avatar Jan 19 '16 12:01 annemarie35

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

matteodem avatar Mar 28 '16 15:03 matteodem