Resets the scroll position on controller content change

When scrolling through the preview of a long article, if the
post was changed the scroll position of the preview would
remain the same.
This commit is contained in:
Robert Rhoades 2014-08-19 11:29:49 +01:00
parent b92f201f08
commit 464db6f289

View File

@ -11,6 +11,10 @@ var PostContentView = Ember.View.extend({
}));
},
contentObserver: function () {
this.$().closest('.content-preview').scrollTop(0);
}.observes('controller.content'),
willDestroyElement: function () {
var el = this.$();
el.off('scroll');