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