2014-06-07 14:07:25 -05:00
|
|
|
import setScrollClassName from 'ghost/utils/set-scroll-classname';
|
2014-07-20 11:42:03 -05:00
|
|
|
import PaginationViewMixin from 'ghost/mixins/pagination-view-infinite-scroll';
|
2014-06-07 14:07:25 -05:00
|
|
|
|
2014-09-09 20:22:11 -05:00
|
|
|
var PaginatedScrollBox = Ember.View.extend(PaginationViewMixin, {
|
|
|
|
attachScrollClassHandler: function () {
|
2014-05-23 22:25:20 -05:00
|
|
|
var el = this.$();
|
2014-06-07 14:07:25 -05:00
|
|
|
el.on('scroll', Ember.run.bind(el, setScrollClassName, {
|
|
|
|
target: el.closest('.content-list'),
|
|
|
|
offset: 10
|
|
|
|
}));
|
2014-09-09 20:22:11 -05:00
|
|
|
}.on('didInsertElement'),
|
2014-10-24 16:09:50 -05:00
|
|
|
|
2014-09-09 20:22:11 -05:00
|
|
|
detachScrollClassHandler: function () {
|
|
|
|
this.$().off('scroll');
|
|
|
|
}.on('willDestroyElement')
|
2014-05-23 22:25:20 -05:00
|
|
|
});
|
|
|
|
|
2014-09-09 20:22:11 -05:00
|
|
|
export default PaginatedScrollBox;
|