diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-09-07 09:09:37 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-09-07 09:09:37 +0000 |
commit | af35fc8c25789eacabb11ddc1fc8685e9279fdf4 (patch) | |
tree | 0cf6cad4ec8b90bf41d9f390a49ad4e6d2fb9014 | |
parent | 8bd419d9c8460c72faf986ca1b5c69e46cca4a1d (diff) | |
parent | cc22a2640f7d9aed743739c583d1fa8f11af2b91 (diff) | |
download | gitlab-ce-af35fc8c25789eacabb11ddc1fc8685e9279fdf4.tar.gz |
Merge branch 'rs-highlight-new-notes' into 'master'
Add syntax highlight scheme to notes rendered client-side
See merge request !1249
-rw-r--r-- | app/assets/javascripts/notes.js.coffee | 1 | ||||
-rw-r--r-- | app/assets/javascripts/syntax_highlight.coffee | 5 |
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() |