Commit 6b0724d0e295756b93281915a90f846ed4148169

Authored by Zambom
1 parent 1ff37090

Adjusting bug of multiple user mentions in comments

Showing 1 changed file with 6 additions and 7 deletions   Show diff stats
mural/templates/mural/_form_comment.html
@@ -109,6 +109,8 @@ @@ -109,6 +109,8 @@
109 contents: '<i class="fa fa-user"/>', 109 contents: '<i class="fa fa-user"/>',
110 tooltip: '{% trans "Mark User" %}', 110 tooltip: '{% trans "Mark User" %}',
111 click: function () { 111 click: function () {
  112 + context.invoke('saveRange');
  113 +
112 var modal_content = $("#add-user-modal").html(); 114 var modal_content = $("#add-user-modal").html();
113 var modal = document.createElement('div'); 115 var modal = document.createElement('div');
114 $(modal).addClass('modal'); 116 $(modal).addClass('modal');
@@ -129,12 +131,9 @@ @@ -129,12 +131,9 @@
129 $(node).addClass('marked_user'); 131 $(node).addClass('marked_user');
130 $(node).html(value); 132 $(node).html(value);
131 133
132 - var code = context.invoke('code');  
133 -  
134 - var new_code = $(code).append(node).append("&nbsp;");  
135 -  
136 - context.invoke('code', new_code);  
137 - 134 + context.invoke('restoreRange');
  135 + context.invoke('pasteHTML', node);
  136 +
138 $(modal).modal('hide'); 137 $(modal).modal('hide');
139 }); 138 });
140 } 139 }
@@ -261,7 +260,7 @@ @@ -261,7 +260,7 @@
261 $(".client-file-errors").show(); 260 $(".client-file-errors").show();
262 $(".format").show(); 261 $(".format").show();
263 } 262 }
264 - 263 +
265 parent.find('.filedrag').html(f.name); 264 parent.find('.filedrag').html(f.name);
266 } 265 }
267 } 266 }