mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-17 05:21:36 +03:00
21 lines
514 B
JavaScript
21 lines
514 B
JavaScript
|
import setScrollClassName from 'ghost/utils/set-scroll-classname';
|
||
|
|
||
|
var PostContentView = Ember.View.extend({
|
||
|
classNames: ['content-preview-content'],
|
||
|
|
||
|
didInsertElement: function () {
|
||
|
var el = this.$();
|
||
|
el.on('scroll', Ember.run.bind(el, setScrollClassName, {
|
||
|
target: el.closest('.content-preview'),
|
||
|
offset: 10
|
||
|
}));
|
||
|
},
|
||
|
|
||
|
willDestroyElement: function () {
|
||
|
var el = this.$();
|
||
|
el.off('scroll');
|
||
|
}
|
||
|
});
|
||
|
|
||
|
export default PostContentView;
|