Commit 6b0724d0e295756b93281915a90f846ed4148169
1 parent
1ff37090
Exists in
master
and in
2 other branches
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 | 109 | contents: '<i class="fa fa-user"/>', |
110 | 110 | tooltip: '{% trans "Mark User" %}', |
111 | 111 | click: function () { |
112 | + context.invoke('saveRange'); | |
113 | + | |
112 | 114 | var modal_content = $("#add-user-modal").html(); |
113 | 115 | var modal = document.createElement('div'); |
114 | 116 | $(modal).addClass('modal'); |
... | ... | @@ -129,12 +131,9 @@ |
129 | 131 | $(node).addClass('marked_user'); |
130 | 132 | $(node).html(value); |
131 | 133 | |
132 | - var code = context.invoke('code'); | |
133 | - | |
134 | - var new_code = $(code).append(node).append(" "); | |
135 | - | |
136 | - context.invoke('code', new_code); | |
137 | - | |
134 | + context.invoke('restoreRange'); | |
135 | + context.invoke('pasteHTML', node); | |
136 | + | |
138 | 137 | $(modal).modal('hide'); |
139 | 138 | }); |
140 | 139 | } |
... | ... | @@ -261,7 +260,7 @@ |
261 | 260 | $(".client-file-errors").show(); |
262 | 261 | $(".format").show(); |
263 | 262 | } |
264 | - | |
263 | + | |
265 | 264 | parent.find('.filedrag').html(f.name); |
266 | 265 | } |
267 | 266 | } | ... | ... |