PERF: hold back rendering of suggested topics 1 run loop.

This commit is contained in:
Sam 2014-12-22 13:18:19 +11:00
parent b279b1daa0
commit 27d43ad6c0
2 changed files with 15 additions and 1 deletions

View file

@ -41,6 +41,20 @@ export default ObjectController.extend(Discourse.SelectedPostsCount, {
}.observes('controllers.search.term', 'controllers.header.visibleDropdown'),
postStreamLoadedAllPostsChanged: function(){
// hold back rendering 1 run loop for every transition.
var self = this;
var loaded = this.get('postStream.loadedAllPosts');
this.set('loadedAllPosts', false);
if(loaded){
Em.run.next(function(){
self.set('loadedAllPosts',true);
});
}
}.observes('postStream', 'postStream.loadedAllPosts'),
show_deleted: function(key, value) {
var postStream = this.get('postStream');
if (!postStream) { return; }

View file

@ -90,7 +90,7 @@
<div id='topic-bottom'></div>
{{#loading-spinner condition=postStream.loadingFilter}}
{{#if postStream.loadedAllPosts}}
{{#if loadedAllPosts}}
{{view 'topic-closing' topic=model}}
{{view 'topic-footer-buttons' topic=model}}