Skip to content

Instantly share code, notes, and snippets.

@SachaG
Created August 25, 2014 02:14
Show Gist options
  • Save SachaG/279e6452d45128b08b06 to your computer and use it in GitHub Desktop.
Save SachaG/279e6452d45128b08b06 to your computer and use it in GitHub Desktop.
template highlighting
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