mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 18:52:05 +03:00
86e47ee4a9
No issue - removes more usage of function prototype extensions in favor of Ember functions - replaces some event calls with the direct function name - adds comments to functions replaced with the event name
28 lines
778 B
JavaScript
28 lines
778 B
JavaScript
import Ember from 'ember';
|
|
import setScrollClassName from 'ghost/utils/set-scroll-classname';
|
|
import PaginationViewMixin from 'ghost/mixins/pagination-view-infinite-scroll';
|
|
|
|
var PaginatedScrollBox = Ember.View.extend(PaginationViewMixin, {
|
|
/**
|
|
* attach the scroll class handler event
|
|
*/
|
|
attachScrollClassHandler: function () {
|
|
var el = this.$();
|
|
el.on('scroll', Ember.run.bind(el, setScrollClassName, {
|
|
target: el.closest('.content-list'),
|
|
offset: 10
|
|
}));
|
|
},
|
|
|
|
didInsertElement: function () {
|
|
this.attachScrollClassHandler();
|
|
},
|
|
|
|
willDestroyElement: function () {
|
|
// removes scroll class handler event
|
|
this.$().off('scroll');
|
|
}
|
|
});
|
|
|
|
export default PaginatedScrollBox;
|