From 6b0724d0e295756b93281915a90f846ed4148169 Mon Sep 17 00:00:00 2001 From: Zambom Date: Sat, 2 Sep 2017 01:27:10 -0300 Subject: [PATCH] Adjusting bug of multiple user mentions in comments --- mural/templates/mural/_form_comment.html | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mural/templates/mural/_form_comment.html b/mural/templates/mural/_form_comment.html index 755cde1..bac36e8 100644 --- a/mural/templates/mural/_form_comment.html +++ b/mural/templates/mural/_form_comment.html @@ -109,6 +109,8 @@ contents: '', tooltip: '{% trans "Mark User" %}', click: function () { + context.invoke('saveRange'); + var modal_content = $("#add-user-modal").html(); var modal = document.createElement('div'); $(modal).addClass('modal'); @@ -129,12 +131,9 @@ $(node).addClass('marked_user'); $(node).html(value); - var code = context.invoke('code'); - - var new_code = $(code).append(node).append(" "); - - context.invoke('code', new_code); - + context.invoke('restoreRange'); + context.invoke('pasteHTML', node); + $(modal).modal('hide'); }); } @@ -261,7 +260,7 @@ $(".client-file-errors").show(); $(".format").show(); } - + parent.find('.filedrag').html(f.name); } } -- libgit2 0.21.2