1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-11-25 01:40:10 +00:00

Introduce {{color}} helper.

This commit is contained in:
hacksalot 2016-01-23 20:24:35 -05:00
parent 1256095e25
commit 20961afb62

View File

@ -56,6 +56,26 @@ Generic template helper definitions for HackMyResume / FluentCV.
return _fromTo.apply( this, arguments );
},
/**
Return a named color value.
@method toFrom
*/
color: function( colorName, colorDefault ) {
// Key must be specified
if( !( colorName && colorName.trim()) ) {
_reportError( HMSTATUS.invalidHelperUse, {
helper: 'fontList', error: HMSTATUS.missingParam, expected: 'name'
});
}
else {
if( !GenericHelpers.theme.colors ) return colorDefault;
var ret = GenericHelpers.theme.colors[ colorName ];
if( !(ret && ret.trim()) )
return colorDefault;
return ret;
}
},
/**
Return true if the section is present on the resume and has at least one
element.