mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
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:
parent
b92f201f08
commit
464db6f289
1 changed files with 4 additions and 0 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Reference in a new issue