summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2015-12-09 12:16:24 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2015-12-09 12:17:00 -0200
commit429932a8b40540faa4d5cbe39119bfeccddd7bab (patch)
treee30e2a826832039d7e4b8d1c87e4ad6188ff60ba /app
parent05f06955bad652fa68901d620c32b30969237c69 (diff)
downloadgitlab-ce-429932a8b40540faa4d5cbe39119bfeccddd7bab.tar.gz
Ensure new notes are highlighted properly on a merge request diff
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/notes.js.coffee10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee
index 5fe0318de6f..b1df56b24fe 100644
--- a/app/assets/javascripts/notes.js.coffee
+++ b/app/assets/javascripts/notes.js.coffee
@@ -148,6 +148,8 @@ class @Notes
@note_ids.push(note.id)
form = $("form[rel='" + note.discussion_id + "']")
row = form.closest("tr")
+ note_html = $(note.html)
+ note_html.syntaxHighlight()
# is this the first note of discussion?
if row.is(".js-temp-notes-holder")
@@ -158,14 +160,16 @@ class @Notes
row.next().find(".note").remove()
# Add note to 'Changes' page discussions
- $(".notes[rel='" + note.discussion_id + "']").append note.html
+ $(".notes[rel='" + note.discussion_id + "']").append note_html
# Init discussion on 'Discussion' page if it is merge request page
if $('body').attr('data-page').indexOf('projects:merge_request') == 0
- $('ul.main-notes-list').append(note.discussion_with_diff_html)
+ discussion_html = $(note.discussion_with_diff_html)
+ discussion_html.syntaxHighlight()
+ $('ul.main-notes-list').append(discussion_html)
else
# append new note to all matching discussions
- $(".notes[rel='" + note.discussion_id + "']").append note.html
+ $(".notes[rel='" + note.discussion_id + "']").append note_html
# cleanup after successfully creating a diff/discussion note
@removeDiscussionNoteForm(form)