From 8075369ec49fde2321be3dc4265ff7016a86481d Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Mon, 29 Jun 2015 20:02:46 +0100 Subject: [PATCH] Part of ACREP-32. Add new Handlebars helper mkws-indexplus. Emits the current index in an iteration, plus a constant. --- src/mkws-handlebars.js | 4 ++++ 1 file changed, 4 insertions(+) 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++) { -- 1.7.10.4