Ghost/core/client/app/components/gh-content-preview-content.js
Kevin Ansfield 117ab27222 Remove setScrollClassName mixin and usage
no issue
- removes `setScrollClassName` mixin that was previously used to add a `.scrolling` class to scrollable elements that showed a shadow at the top of boxes when not scrolled to the top
2015-12-15 12:00:57 +00:00

23 lines
541 B
JavaScript

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);
}
}
}
});