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:
1d5de71
)
Documentation for the #if-any helper.
author
Mike Taylor
<mike@indexdata.com>
Thu, 28 Nov 2013 16:25:33 +0000
(16:25 +0000)
committer
Mike Taylor
<mike@indexdata.com>
Thu, 28 Nov 2013 16:25:33 +0000
(16:25 +0000)
tools/htdocs/mkws.js
patch
|
blob
|
history
diff --git
a/tools/htdocs/mkws.js
b/tools/htdocs/mkws.js
index
deb0649
..
769c574
100644
(file)
--- a/
tools/htdocs/mkws.js
+++ b/
tools/htdocs/mkws.js
@@
-124,6
+124,12
@@
Handlebars.registerHelper('attr', function(attrName) {
});
+/*
+ * Use as follows: {{#if-any NAME1 having="NAME2"}}
+ * Applicable when NAME1 is the name of an array
+ * The guarded code runs only if at least one element of the NAME1
+ * array has a subelement called NAME2.
+ */
Handlebars.registerHelper('if-any', function(items, options) {
var having = options.hash.having;
for (var i in items) {