Do not delete comment containers; replace them with success message. This also fixes a visual bug when deleting the last comment

This commit is contained in:
Maximilian Grundke
2017-08-25 18:33:39 +02:00
parent 73ec4d0902
commit bb79852e42
4 changed files with 17 additions and 5 deletions

View File

@@ -308,11 +308,7 @@ also, all settings from the rails model needed for the editor configuration in t
var commentId = $(event.target).data('comment-id');
deleteComment(commentId, editor, fileid, function () {
var parent = $(button).parent().parent();
parent.siblings().first().remove(); // potential divider
parent.remove(); // the comment itself
if (container.html() === '') {
otherComments.hide();
}
parent.html('<div class="comment-removed"><%= t('comments.deleted') %></div>');
});
});
});