Merge pull request #414 from dimdenGD/patch-4

Fix breaking editor
This commit is contained in:
Kyle Drake 2022-11-12 13:15:47 -06:00 committed by GitHub
commit ca9b897d5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
var ProfileComment = { var ProfileComment = {
displayEditor: function(eventId) { displayEditor: function(eventId) {
var commentDiv = $('#event_'+eventId+' div.content') var commentDiv = $('#event_'+eventId+' div.content').first()
var eventActions = $('#event_'+eventId+'_actions') var eventActions = $('#event_'+eventId+'_actions').first()
eventActions.find('a#editLink').css('display', 'none') eventActions.find('a#editLink').css('display', 'none')
@ -10,15 +10,14 @@ var ProfileComment = {
}, },
cancelEditor: function(eventId) { cancelEditor: function(eventId) {
var eventActions = $('#event_'+eventId+'_actions') var eventActions = $('#event_'+eventId+'_actions').first()
var commentDiv = $('#event_'+eventId+' div.content') var commentDiv = $('#event_'+eventId+' div.content').first()
eventActions.find('a#editLink').css('display', 'inline') eventActions.find('a#editLink').css('display', 'inline')
commentDiv.text(commentDiv.find('textarea').text()) commentDiv.text(commentDiv.find('textarea').text())
}, },
update: function(eventId, csrfToken) { update: function(eventId, csrfToken) {
var eventActions = $('#event_'+eventId+'_actions') var commentDiv = $('#event_'+eventId+' div.content').first()
var commentDiv = $('#event_'+eventId+' div.content')
var self = this var self = this
console.log(commentDiv.find('textarea').val()) console.log(commentDiv.find('textarea').val())
$.post('/event/'+eventId+'/update_profile_comment', { $.post('/event/'+eventId+'/update_profile_comment', {