Created
August 25, 2014 02:14
-
-
Save SachaG/279e6452d45128b08b06 to your computer and use it in GitHub Desktop.
template highlighting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var oldCreate = Template.__create__; | |
Template.__create__ = function(viewName) { | |
var tmpl = oldCreate.apply(this, arguments); | |
var oldRender = tmpl.__render; | |
tmpl.__render = function() { | |
var className = viewName.replace('Template.', 'template-highlight '); | |
return HTML.SPAN({class: className}, oldRender.apply(this, arguments)); | |
} | |
return tmpl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment