1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/views/paginated-scroll-box.js
Jason Williams e1666234be Enable JSCS checking on client.
Refs #4001
- grunt-jscs@0.8.1 which provides ES6 support.
2014-10-25 16:13:04 +00:00

18 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;