Optimize DOM query selectors

pull/647/merge
Thibaut Courouble 8 years ago
parent 581e656fd2
commit d7001c2eb5

@ -50,11 +50,11 @@ class app.views.EntryPage extends app.View
@clipBoardLink.className = '_pre-clip' @clipBoardLink.className = '_pre-clip'
@clipBoardLink.title = 'Copy to clipboard' @clipBoardLink.title = 'Copy to clipboard'
@clipBoardLink.tabIndex = -1 @clipBoardLink.tabIndex = -1
el.appendChild(@clipBoardLink.cloneNode()) for el in @el.querySelectorAll('pre') el.appendChild(@clipBoardLink.cloneNode()) for el in @findAllByTag('pre')
return return
polyfillMathML: -> polyfillMathML: ->
return unless window.supportsMathML is false and !@polyfilledMathML and @find('math') return unless window.supportsMathML is false and !@polyfilledMathML and @findByTag('math')
@polyfilledMathML = true @polyfilledMathML = true
$.append document.head, """<link rel="stylesheet" href="#{app.config.mathml_stylesheet}">""" $.append document.head, """<link rel="stylesheet" href="#{app.config.mathml_stylesheet}">"""
return return

Loading…
Cancel
Save