From ebe7a302b6370d6188f5ab43d10f66fef4d8deb5 Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Mon, 27 Feb 2012 12:29:09 -0800 Subject: [PATCH] DG MS; comments are back! --- public/javascripts/app/models/post.js | 6 ++++++ public/javascripts/app/templates/stream-faces.handlebars | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/public/javascripts/app/models/post.js b/public/javascripts/app/models/post.js index 3994b760c..a8ddf1c59 100644 --- a/public/javascripts/app/models/post.js +++ b/public/javascripts/app/models/post.js @@ -1,6 +1,12 @@ app.models.Post = Backbone.Model.extend({ urlRoot : "/posts", + initialize : function() { + this.setupCollections(); + this.bind("change", this.setupCollections, this) + }, + + setupCollections: function() { this.comments = new app.collections.Comments(this.get("comments") || this.get("last_three_comments"), {post : this}); this.likes = new app.collections.Likes([], {post : this}); // load in the user like initially this.participations = new app.collections.Participations([], {post : this}); // load in the user like initially diff --git a/public/javascripts/app/templates/stream-faces.handlebars b/public/javascripts/app/templates/stream-faces.handlebars index 68a752adb..6db001f19 100644 --- a/public/javascripts/app/templates/stream-faces.handlebars +++ b/public/javascripts/app/templates/stream-faces.handlebars @@ -1,5 +1,5 @@ {{#people}} {{#linkToPerson this}} - {{{avatar this "small"}}} + {{{personImage this "small"}}} {{/linkToPerson}} {{/people}}