You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/assets/javascripts/views/pages/base.coffee

18 lines
467 B

class app.views.BasePage extends app.View
constructor: (@el, @entry) -> super
render: (content) ->
@addClass "_#{@entry.doc.type}" unless @constructor.className
@html content
@activate()
@delay @afterRender if @afterRender
return
highlightCode: (el, language) ->
if $.isCollection(el)
@highlightCode e, language for e in el
else if el
el.classList.add "language-#{language}"
Prism.highlightElement(el)
return