Comments: Put comment content inside a span

So when editing we do not override the author's name.
This commit is contained in:
2017-11-08 22:01:34 +01:00
parent 8ef89d0b53
commit cb0272fe60
3 changed files with 4 additions and 4 deletions

View File

@@ -235,7 +235,7 @@ function commentEditCancel(clicked_item, reload_comment) {
return loadComment(comment_id, {'properties.content': 1}) return loadComment(comment_id, {'properties.content': 1})
.done(function(data) { .done(function(data) {
var comment_html = data['properties']['content_html']; var comment_html = data['properties']['content_html'];
comment_container.find('.comment-body').html(comment_html); comment_container.find('.comment-body span').html(comment_html);
}) })
.fail(function(xhr) { .fail(function(xhr) {
if (console) console.log('Error fetching comment: ', xhr); if (console) console.log('Error fetching comment: ', xhr);

View File

@@ -11,7 +11,7 @@
.comment-body .comment-body
p.comment-author {{ comment._user.full_name }} p.comment-author {{ comment._user.full_name }}
| {{comment.properties.content_html | safe }} span {{comment.properties.content_html | safe }}
// TODO: Markdown preview when editing // TODO: Markdown preview when editing

View File

@@ -154,7 +154,7 @@ script.
var $parent_div = $(this).closest('.comment-container'); var $parent_div = $(this).closest('.comment-container');
var comment_id = $parent_div.data('node-id'); var comment_id = $parent_div.data('node-id');
var comment_content = $parent_div.find('.comment-body'); var comment_content = $parent_div.find('.comment-body span');
var height = comment_content.height(); var height = comment_content.height();
loadComment(comment_id, {'properties.content': 1}) loadComment(comment_id, {'properties.content': 1})
@@ -207,7 +207,7 @@ script.
.done(function(comment_id, comment_html) { .done(function(comment_id, comment_html) {
commentEditCancel($button, false) commentEditCancel($button, false)
$container.find('.comment-body') $container.find('.comment-body span')
.html(comment_html) .html(comment_html)
.flashOnce(); .flashOnce();