0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00
ghost/core/client/app/components/gh-content-preview-content.js

23 lines
541 B
JavaScript
Raw Normal View History

2015-02-12 23:22:32 -05:00
import Ember from 'ember';
const {Component} = Ember;
export default Component.extend({
classNames: ['content-preview-content'],
content: null,
didReceiveAttrs(options) {
this._super(...arguments);
// adjust when didReceiveAttrs gets both newAttrs and oldAttrs
if (options.newAttrs.content && this.get('content') !== options.newAttrs.content.value) {
let el = this.$();
if (el) {
el.closest('.content-preview').scrollTop(0);
}
}
}
});