Skip to content

Commit

Permalink
fix demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel committed Oct 20, 2019
1 parent daac58c commit 1380682
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion demos/demo_json_init_with_mustache/index-jsonfromform.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,20 @@ <h1>Blapy Block results in a Table</h1>

window.setColorToData = function(aJson)
{
aJson = aJson.map( (aData) => {
var aJsonArray = [];
if (!Array.isArray(aJson))
aJsonArray[0] = aJson;
else
aJsonArray = aJson;

aJson = aJsonArray.map( (aData) => {
if (aData.firstname == "John") aData["colorFirstName"] = "green";
else aData["colorFirstName"] = "blue";
if (aData.lastname == "Rabbit") aData["colorLastName"] = "red";
else aData["colorLastName"] = "cyan";
return aData;
});

return aJson;
}

Expand Down

0 comments on commit 1380682

Please sign in to comment.