From 464db6f289d189542b46c2adfa12d6578ea0cdd3 Mon Sep 17 00:00:00 2001 From: Robert Rhoades Date: Tue, 19 Aug 2014 11:29:49 +0100 Subject: [PATCH] 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. --- core/client/views/content-preview-content-view.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/client/views/content-preview-content-view.js b/core/client/views/content-preview-content-view.js index d2c6910614..2b9be2c0d9 100644 --- a/core/client/views/content-preview-content-view.js +++ b/core/client/views/content-preview-content-view.js @@ -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');