Skip to content
This repository has been archived by the owner on Mar 4, 2021. It is now read-only.

Commit

Permalink
Merge pull request chartjs#438 from Miosss/templateEnchanceme
Browse files Browse the repository at this point in the history
Alternative scale templating. Passing function as template.
  • Loading branch information
nnnick committed Jul 27, 2014
2 parents 61467e1 + d193951 commit 5683c11
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Chart.Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,12 @@
//Templating methods
//Javascript micro templating by John Resig - source at http://ejohn.org/blog/javascript-micro-templating/
template = helpers.template = function(templateString, valuesObject){
// If templateString is function rather than string-template - call the function for valuesObject
if(templateString instanceof Function)
{
return templateString(valuesObject);
}

var cache = {};
function tmpl(str, data){
// Figure out if we're getting a template, or if we need to
Expand Down

0 comments on commit 5683c11

Please sign in to comment.