diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index b628e13eb5c..cf951aa3899 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -427,7 +427,22 @@ $html.syntaxHighlight(); $html.find('.js-task-list-container').taskList('enable'); $note_li = $('.note-row-' + note.id); - return $note_li.replaceWith($html); + + if (DiffNotesApp != null) { + ref = DiffNotesApp.$refs['' + note.id + '']; + + if (ref) { + ref.$destroy(true); + } + } + + $note_li.replaceWith($html); + + if ($('resolve-btn, resolve-all-btn').length && (typeof DiffNotesApp !== "undefined" && DiffNotesApp !== null)) { + $('resolve-btn, resolve-all-btn').each(function () { + DiffNotesApp.$compile($(this).get(0)) + }); + } };