Skip to content

Commit

Permalink
Merge pull request TryGhost#4765 from martinnormark/master
Browse files Browse the repository at this point in the history
Load next page if scrollHeight <= clientHeight
  • Loading branch information
ErisDS committed Jan 12, 2015
2 parents 3052f60 + 3faf4de commit e6305e8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/client/mixins/pagination-view-infinite-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ var PaginationViewInfiniteScrollMixin = Ember.Mixin.create({
* Bind to the scroll event once the element is in the DOM
*/
attachCheckScroll: function () {
var el = this.$();
var el = this.$(),
controller = this.get('controller');

el.on('scroll', Ember.run.bind(this, this.checkScroll));

if (this.element.scrollHeight <= this.element.clientHeight) {
controller.send('loadNextPage');
}
}.on('didInsertElement'),

/**
Expand Down

0 comments on commit e6305e8

Please sign in to comment.