X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=769c574580c2572aa8eb4b8db64de9f818e783d0;hb=bd512b55ee9b9bb1d19633d7242b9c36ec4c08e0;hp=deb0649a832a1145d2684b447a01ce35fa9f7f64;hpb=1d5de7112ab9f1f3ffadf04539e787df0113ad13;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index deb0649..769c574 100644 --- 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) {