Commit 7c20f30f authored by Robert Speicher's avatar Robert Speicher

Ensure notes are highlighted properly when they're updated

parent 9ade9a64
...@@ -277,13 +277,15 @@ class @Notes ...@@ -277,13 +277,15 @@ class @Notes
Updates the current note field. Updates the current note field.
### ###
updateNote: (xhr, note, status) => updateNote: (_xhr, note, _status) =>
note_li = $(".note-row-" + note.id) # Convert returned HTML to a jQuery object so we can modify it further
note_li.replaceWith(note.html) $html = $(note.html)
note_li.find('.note-edit-form').hide() $html.syntaxHighlight()
note_li.find('.note-body > .note-text').show() $html.find('.js-task-list-container').taskList('enable')
note_li.find('js-task-list-container').taskList('enable')
@enableTaskList() # Find the note's `li` element by ID and replace it with the updated HTML
$note_li = $("#note_#{note.id}")
$note_li.replaceWith($html)
### ###
Called in response to clicking the edit note link Called in response to clicking the edit note link
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment