Commit af35fc8c authored by Douwe Maan's avatar Douwe Maan

Merge branch 'rs-highlight-new-notes' into 'master'

Add syntax highlight scheme to notes rendered client-side

See merge request !1249
parents 8bd419d9 cc22a264
...@@ -123,6 +123,7 @@ class @Notes ...@@ -123,6 +123,7 @@ class @Notes
if @isNewNote(note) if @isNewNote(note)
@note_ids.push(note.id) @note_ids.push(note.id)
$('ul.main-notes-list').append(note.html) $('ul.main-notes-list').append(note.html)
$('.js-syntax-highlight').syntaxHighlight()
@initTaskList() @initTaskList()
### ###
......
...@@ -5,5 +5,8 @@ ...@@ -5,5 +5,8 @@
# #
# <div class="js-syntax-highlight"></div> # <div class="js-syntax-highlight"></div>
# #
$.fn.syntaxHighlight = ->
$(this).addClass(gon.user_color_scheme)
$(document).on 'ready page:load', -> $(document).on 'ready page:load', ->
$('.js-syntax-highlight').addClass(gon.user_color_scheme) $('.js-syntax-highlight').syntaxHighlight()
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