FIX: Was not resuming scroll position on back button

This commit is contained in:
Robin Ward 2014-02-11 15:17:36 -05:00
parent 14f075e812
commit d44d2b3f10
1 changed files with 10 additions and 1 deletions

View File

@ -7,7 +7,7 @@
@namespace Discourse
@module Discourse
**/
Discourse.DiscoveryTopicsView = Discourse.View.extend(Discourse.ScrollTop, Discourse.LoadMore, {
Discourse.DiscoveryTopicsView = Discourse.View.extend(Discourse.LoadMore, {
eyelineSelector: '.topic-list-item',
actions: {
@ -25,6 +25,15 @@ Discourse.DiscoveryTopicsView = Discourse.View.extend(Discourse.ScrollTop, Disco
}
},
_readjustScrollPosition: function() {
var scrollTo = Discourse.Session.currentProp('topicListScrollPosition');
if (scrollTo) {
Em.run.schedule('afterRender', function() {
$(window).scrollTop(scrollTo);
});
}
}.on('didInsertElement'),
_updateTitle: function() {
Discourse.notifyTitle(this.get('controller.topicTrackingState.incomingCount'));
}.observes('controller.topicTrackingState.incomingCount'),