Ghost/core/client/app/components/gh-infinite-scroll-box.js

23 lines
563 B
JavaScript
Raw Normal View History

import Ember from 'ember';
import InfiniteScrollMixin from 'ghost/mixins/infinite-scroll';
import setScrollClassName from 'ghost/utils/set-scroll-classname';
export default Ember.Component.extend(InfiniteScrollMixin, {
didRender: function () {
this._super();
var el = this.$();
el.on('scroll', Ember.run.bind(el, setScrollClassName, {
target: el.closest('.content-list'),
offset: 10
}));
},
willDestroyElement: function () {
this._super();
this.$().off('scroll');
}
});