Last active
December 16, 2015 13:18
-
-
Save jordantomax/5440241 to your computer and use it in GitHub Desktop.
Revisions
-
jordantomax revised this gist
Apr 23, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Handlebars.registerHelper("foreach",function(arr,options) { } return arr.map(function(item,index) { if (typeof item === 'string') { var item = new String(item); } -
jordantomax revised this gist
Apr 23, 2013 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,16 @@ Handlebars.registerHelper("foreach",function(arr,options) { if (options.inverse && !arr.length) { return options.inverse(this); } return arr.map(function(item,index) { if (typeof item == 'string') { var item = new String(item); } item.$index = index; item.$first = index === 0; item.$last = index === arr.length-1; return options.fn(item); }).join(''); }); -
jordantomax revised this gist
Apr 23, 2013 . 1 changed file with 5 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,12 @@ Handlebars.registerHelper("foreach",function(arr,options) { if (options.inverse && !arr.length) { return options.inverse(this); } return arr.map(function(item,index) { if (typeof item == 'string') { var item = new String(item); } item.$index = index; item.$first = index === 0; -
jordantomax revised this gist
Apr 23, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,9 +3,9 @@ Handlebars.registerHelper("foreach",function(arr,options) { return options.inverse(this); return arr.map(function(item,index) { if (typeof item == 'string') { var item = new String(item) } item.$index = index; item.$first = index === 0; -
jordantomax created this gist
Apr 23, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ Handlebars.registerHelper("foreach",function(arr,options) { if(options.inverse && !arr.length) return options.inverse(this); return arr.map(function(item,index) { if (typeof item == 'string') { var item = new String(item) } item.$index = index; item.$first = index === 0; item.$last = index === arr.length-1; return options.fn(item); }).join(''); });