From 690e47c9469c288be5fd1fccbfa89f458c9d10d3 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 18 Aug 2013 17:14:49 +0200 Subject: [PATCH] Don't collapse comment content in the SPV. --- app/assets/javascripts/app/views/comment_view.js | 5 +++++ .../single-post-viewer/single_post_comment_stream.js | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/app/assets/javascripts/app/views/comment_view.js b/app/assets/javascripts/app/views/comment_view.js index 25d4a5c52..8ed7ff48a 100644 --- a/app/assets/javascripts/app/views/comment_view.js +++ b/app/assets/javascripts/app/views/comment_view.js @@ -33,3 +33,8 @@ app.views.Comment = app.views.Content.extend({ return app.currentUser.authenticated() && (this.ownComment() || this.postOwner()) } }); + +app.views.ExpandedComment = app.views.Comment.extend({ + postRenderTemplate : function(){ + } +}); diff --git a/app/assets/javascripts/app/views/single-post-viewer/single_post_comment_stream.js b/app/assets/javascripts/app/views/single-post-viewer/single_post_comment_stream.js index 787f7b004..fdc478286 100644 --- a/app/assets/javascripts/app/views/single-post-viewer/single_post_comment_stream.js +++ b/app/assets/javascripts/app/views/single-post-viewer/single_post_comment_stream.js @@ -5,6 +5,16 @@ app.views.SinglePostCommentStream = app.views.CommentStream.extend({ this.$(".new_comment_form_wrapper").removeClass('hidden') }, + appendComment: function(comment) { + // Set the post as the comment's parent, so we can check + // on post ownership in the Comment view. + comment.set({parent : this.model.toJSON()}) + + this.$(".comments").append(new app.views.ExpandedComment({ + model: comment + }).render().el); + }, + presenter: function(){ return _.extend(this.defaultPresenter(), { moreCommentsCount : 0,