mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 18:52:05 +03:00
23 lines
563 B
JavaScript
23 lines
563 B
JavaScript
|
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');
|
||
|
}
|
||
|
});
|