PERF: don't render composer until we need it

This commit is contained in:
Sam 2014-12-11 16:21:39 +11:00
parent 8b87f095c6
commit 32b52642ab
2 changed files with 8 additions and 1 deletions

View File

@ -465,6 +465,11 @@ export default DiscourseController.extend({
canEdit: function() {
return this.get("model.action") === "edit" && Discourse.User.current().get("can_edit");
}.property("model.action")
}.property("model.action"),
visible: function() {
var state = this.get('model.composeState');
return state && state !== 'closed';
}.property('model.composeState')
});

View File

@ -1,3 +1,4 @@
{{#if visible}}
<div class='composer-loading'>
{{loading-spinner}}
</div>
@ -116,3 +117,4 @@
</div>
</div>
{{/if}}