summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-09-04 17:07:24 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-09-04 17:07:24 -0400
commitcc22a2640f7d9aed743739c583d1fa8f11af2b91 (patch)
tree2a8260e8dbaad41fb5ee8d12939780f16cf60473
parent50f76ae0eae29f7362702da274055f76a350ee6f (diff)
downloadgitlab-ce-rs-highlight-new-notes.tar.gz
Add syntax highlight scheme to notes rendered client-siders-highlight-new-notes
-rw-r--r--app/assets/javascripts/notes.js.coffee1
-rw-r--r--app/assets/javascripts/syntax_highlight.coffee5
2 files changed, 5 insertions, 1 deletions
diff --git a/app/assets/javascripts/notes.js.coffee b/app/assets/javascripts/notes.js.coffee
index 0021d17d85e..b7f2c63c5a7 100644
--- a/app/assets/javascripts/notes.js.coffee
+++ b/app/assets/javascripts/notes.js.coffee
@@ -123,6 +123,7 @@ class @Notes
if @isNewNote(note)
@note_ids.push(note.id)
$('ul.main-notes-list').append(note.html)
+ $('.js-syntax-highlight').syntaxHighlight()
@initTaskList()
###
diff --git a/app/assets/javascripts/syntax_highlight.coffee b/app/assets/javascripts/syntax_highlight.coffee
index 510f15d1b49..71295cd4b08 100644
--- a/app/assets/javascripts/syntax_highlight.coffee
+++ b/app/assets/javascripts/syntax_highlight.coffee
@@ -5,5 +5,8 @@
#
# <div class="js-syntax-highlight"></div>
#
+$.fn.syntaxHighlight = ->
+ $(this).addClass(gon.user_color_scheme)
+
$(document).on 'ready page:load', ->
- $('.js-syntax-highlight').addClass(gon.user_color_scheme)
+ $('.js-syntax-highlight').syntaxHighlight()