mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
PERF: hold back rendering of suggested topics 1 run loop.
This commit is contained in:
parent
b279b1daa0
commit
27d43ad6c0
2 changed files with 15 additions and 1 deletions
|
@ -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; }
|
||||
|
|
|
@ -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}}
|
||||
|
|
Loading…
Reference in a new issue