1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/views/content-preview-content-view.js
Austin Burdine 0c5883cae0 removes usage of prototype extensions
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
2015-06-15 14:07:25 -04:00

29 lines
735 B
JavaScript

import Ember from 'ember';
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
}));
},
contentObserver: Ember.observer('controller.content', function () {
var el = this.$();
if (el) {
el.closest('.content-preview').scrollTop(0);
}
}),
willDestroyElement: function () {
var el = this.$();
el.off('scroll');
}
});
export default PostContentView;