0.0.2 • Published 8 years ago

ember-zbj-infinite-scroller v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

ember-simple-infinite-scroller

       

This Ember addon provides a simple component that fires an action whenever it is scrolled to the bottom. Allowing you to load more data. It is not coupled to Ember-Data like some other infinite scrolling implementations.

Installation

ember install ember-simple-infinite-scroller

Example usage

{{#infinite-scroller on-load-more=(action 'loadMore') as |scroller|}}
  {{#each things as |thing|}}
    ...
  {{/each}}
  {{if scroller.isLoading 'Please wait...'}}
{{/infinite-scroller}}

Configuration

Element vs Document scroll

Either make your component scrollable:

.my-element {
  max-height: 300px;
  overflow: auto;
}

OR

Set use-document=true if your component is not scrollable.

{{#infinite-scroller use-document=true}}
  {{! action will fire when the document is scrolled to the bottom }}
{{/infinite-scroller}}

Yielded API

The component will yield a hash that provides: