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 @@ # #
# +$.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()