From c5d019494659411f230b7644de72d7511ae2a49d Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Fri, 28 Jun 2019 15:08:22 -0700 Subject: [PATCH] fix for profile comment editing --- public/js/news/profile_comment.js | 16 ++++++++-------- views/_news_profile_comment.erb | 4 +--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/public/js/news/profile_comment.js b/public/js/news/profile_comment.js index 7f6effa0..13c7d533 100644 --- a/public/js/news/profile_comment.js +++ b/public/js/news/profile_comment.js @@ -1,24 +1,24 @@ var ProfileComment = { displayEditor: function(eventId) { - var commentDiv = $('#event_'+eventId+' div.title div.comment') + var commentDiv = $('#event_'+eventId+' div.content') var eventActions = $('#event_'+eventId+'_actions') - + eventActions.find('a#editLink').css('display', 'none') - + commentDiv.html(Template.template($('#comment-edit-template').html(), {eventId: eventId, content: commentDiv.text()})) $('#event_'+eventId+' div.title div.comment').text() }, - + cancelEditor: function(eventId) { var eventActions = $('#event_'+eventId+'_actions') - var commentDiv = $('#event_'+eventId+' div.title div.comment') + var commentDiv = $('#event_'+eventId+' div.content') eventActions.find('a#editLink').css('display', 'inline') commentDiv.text(commentDiv.find('textarea').text()) }, - + update: function(eventId, csrfToken) { var eventActions = $('#event_'+eventId+'_actions') - var commentDiv = $('#event_'+eventId+' div.title div.comment') + var commentDiv = $('#event_'+eventId+' div.content') var self = this console.log(commentDiv.find('textarea').val()) $.post('/event/'+eventId+'/update_profile_comment', { @@ -29,4 +29,4 @@ var ProfileComment = { self.cancelEditor(eventId) }) } -} \ No newline at end of file +} diff --git a/views/_news_profile_comment.erb b/views/_news_profile_comment.erb index 8a8cad98..d1571e36 100644 --- a/views/_news_profile_comment.erb +++ b/views/_news_profile_comment.erb @@ -21,6 +21,4 @@ <%= profile_comment.created_at.ago %> -
- <%== sanitize_comment profile_comment.message %> -
+
<%== sanitize_comment profile_comment.message %>