1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2025-05-10 07:47:07 +01:00

Improve Underscore.js rendering support.

This commit is contained in:
hacksalot
2016-01-22 10:36:26 -05:00
parent 4fe74057f9
commit 915f35b1e6
2 changed files with 62 additions and 12 deletions

View File

@ -0,0 +1,34 @@
/**
Template helper definitions for Underscore.
@license MIT. Copyright (c) 2016 hacksalot (https://github.com/hacksalot)
@module handlebars-helpers.js
*/
(function() {
var HANDLEBARS = require('handlebars')
, _ = require('underscore')
, helpers = require('./generic-helpers');
/**
Register useful Underscore helpers.
@method registerHelpers
*/
module.exports = function( theme, opts, cssInfo, ctx, eng ) {
helpers.theme = theme;
helpers.opts = opts;
helpers.cssInfo = cssInfo;
helpers.engine = eng;
ctx.h = helpers;
_.each( helpers, function( hVal, hKey ) {
if( _.isFunction( hVal )) {
_.bind( hVal, ctx );
}
}, this);
};
}());