mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2024-11-05 01:56:21 +00:00
Introduce {{color}} helper.
This commit is contained in:
parent
1256095e25
commit
20961afb62
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user