Ghost/core/client/views/content-preview-content-view.js
David Arvelo 8c3970c9ba Add shadows to PostsListView and the adjacent HTML Preview; Fix preview render
closes #2906
- add a utility function to add classnames to targets, retrofitted from clientold to accommodate `Ember.run.bind`
- create a content-preview view that tracks its scrolling
- add a scroll handler to the existing PostsListView
- The `posts/post` template now takes its HTML from the post model instead of using the editor's markdown component
2014-06-08 12:53:54 -04:00

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;