Add syntax highlight scheme to notes rendered client-side
This commit is contained in:
parent
50f76ae0ea
commit
cc22a2640f
2 changed files with 5 additions and 1 deletions
|
@ -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()
|
||||
|
||||
###
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue