Add syntax highlight scheme to notes rendered client-side

This commit is contained in:
Robert Speicher 2015-09-04 17:07:24 -04:00
parent 50f76ae0ea
commit cc22a2640f
2 changed files with 5 additions and 1 deletions

View file

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

View file

@ -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()