meteor-easy-search
meteor-easy-search copied to clipboard
Infinite scroll for LoadMore component
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?
yeah sure, I think a parameter on the LoadMore button might be the way to go.
{{> EasySearch.LoadMore infiniteScroll=true }}, maybe?
Up, would be very useful ^^
Feel free to add PR's if you want to contribute to this package.