mirror of
https://github.com/neocities/neocities.git
synced 2025-04-24 17:22:35 +02:00
fix for profile comment editing
This commit is contained in:
parent
54a27a23ed
commit
c5d0194946
2 changed files with 9 additions and 11 deletions
|
@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,6 +21,4 @@
|
|||
<a href="/site/<%= site.username %>?event_id=<%= profile_comment.event.id %>"><%= profile_comment.created_at.ago %></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<%== sanitize_comment profile_comment.message %>
|
||||
</div>
|
||||
<div class="content"><%== sanitize_comment profile_comment.message %></div>
|
||||
|
|
Loading…
Add table
Reference in a new issue