projects
/
mkws-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35a76bb
)
Part of ACREP-32.
author
Mike Taylor
<mike@indexdata.com>
Mon, 29 Jun 2015 19:02:46 +0000
(20:02 +0100)
committer
Mike Taylor
<mike@indexdata.com>
Mon, 29 Jun 2015 19:02:46 +0000
(20:02 +0100)
Add new Handlebars helper mkws-indexplus.
Emits the current index in an iteration, plus a constant.
src/mkws-handlebars.js
patch
|
blob
|
history
diff --git
a/src/mkws-handlebars.js
b/src/mkws-handlebars.js
index
3a59e9c
..
27975cd
100644
(file)
--- 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++) {