From: Mike Taylor Date: Mon, 29 Jun 2015 19:02:46 +0000 (+0100) Subject: Part of ACREP-32. X-Git-Url: http://git.indexdata.com/?p=mkws-moved-to-github.git;a=commitdiff_plain;h=8075369ec49fde2321be3dc4265ff7016a86481d;hp=35a76bb14959296357216c4166b7d6a1f3bf33e5 Part of ACREP-32. Add new Handlebars helper mkws-indexplus. Emits the current index in an iteration, plus a constant. --- diff --git a/src/mkws-handlebars.js b/src/mkws-handlebars.js index 3a59e9c..27975cd 100644 --- a/src/mkws-handlebars.js +++ b/src/mkws-handlebars.js @@ -122,6 +122,10 @@ Handlebars.registerHelper('mkws-index1', function(obj) { return obj.data.index + 1; }); +Handlebars.registerHelper('mkws-indexplus', function(delta, obj) { + return obj.data.index + delta; +}); + Handlebars.registerHelper('mkws-repeat', function(count, options) { var out = ""; for (var i = 0; i < count; i++) {