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

View File

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