mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 20:34:02 +03:00
ab7951ea16
Closes #3950 - Fixed up event attachment and removal in a few mixins - Renamed content-list-content-view to something more understandable - simplify transition from posts.index to posts.post
19 lines
613 B
JavaScript
19 lines
613 B
JavaScript
import setScrollClassName from 'ghost/utils/set-scroll-classname';
|
|
import PaginationViewMixin from 'ghost/mixins/pagination-view-infinite-scroll';
|
|
|
|
|
|
var PaginatedScrollBox = Ember.View.extend(PaginationViewMixin, {
|
|
attachScrollClassHandler: function () {
|
|
var el = this.$();
|
|
el.on('scroll', Ember.run.bind(el, setScrollClassName, {
|
|
target: el.closest('.content-list'),
|
|
offset: 10
|
|
}));
|
|
}.on('didInsertElement'),
|
|
detachScrollClassHandler: function () {
|
|
this.$().off('scroll');
|
|
}.on('willDestroyElement')
|
|
});
|
|
|
|
export default PaginatedScrollBox;
|