mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Load next page if scrollHeight <= clientHeight
closes #4764 - call loadNextPage in attachCheckScroll, if element scrollHeight <= clientHeight
This commit is contained in:
parent
5f016f7826
commit
271b9f5768
@ -22,9 +22,14 @@ var PaginationViewInfiniteScrollMixin = Ember.Mixin.create({
|
|||||||
* Bind to the scroll event once the element is in the DOM
|
* Bind to the scroll event once the element is in the DOM
|
||||||
*/
|
*/
|
||||||
attachCheckScroll: function () {
|
attachCheckScroll: function () {
|
||||||
var el = this.$();
|
var el = this.$(),
|
||||||
|
controller = this.get('controller');
|
||||||
|
|
||||||
el.on('scroll', Ember.run.bind(this, this.checkScroll));
|
el.on('scroll', Ember.run.bind(this, this.checkScroll));
|
||||||
|
|
||||||
|
if (this.element.scrollHeight <= this.element.clientHeight) {
|
||||||
|
controller.send('loadNextPage');
|
||||||
|
}
|
||||||
}.on('didInsertElement'),
|
}.on('didInsertElement'),
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user