0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/client/app/components/gh-infinite-scroll-box.js

24 lines
585 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';
const {Component, run} = Ember;
export default Component.extend(InfiniteScrollMixin, {
didRender() {
let el = this.$();
this._super(...arguments);
el.on('scroll', run.bind(el, setScrollClassName, {
target: el.closest('.content-list'),
offset: 10
}));
},
willDestroyElement() {
this._super(...arguments);
this.$().off('scroll');
}
});