FIX: stop hiding suggested topics when new posts show up

This commit is contained in:
Sam 2015-03-05 17:35:24 +11:00
parent 36e02ed49b
commit bf8fd0815f
1 changed files with 10 additions and 4 deletions

View File

@ -44,11 +44,17 @@ export default ObjectController.extend(Discourse.SelectedPostsCount, BufferedCon
}.observes('controllers.search.term', 'controllers.header.visibleDropdown'),
postStreamLoadedAllPostsChanged: function(){
// in the past we would hold back rendering of suggested topics
// 1 run loop, however post optimisations rendering them is fast
// holding back rendering just makes for a more jerky UI on initial
// transition
// semantics of loaded all posts are slightly diff at topic level,
// it just means that we "once" loaded all posts, this means we don't
// keep re-rendering the suggested topics when new posts zoom in
var loaded = this.get('postStream.loadedAllPosts');
if(loaded) {
this.set('loadedTopicId', this.get('model.id'));
} else {
loaded = this.get('loadedTopicId') === this.get('model.id');
}
this.set('loadedAllPosts', loaded);
}.observes('postStream', 'postStream.loadedAllPosts'),