You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/assets/javascripts/templates/base.js

16 lines
366 B

1 year ago
app.templates.render = function (name, value, ...args) {
const template = app.templates[name];
11 years ago
if (Array.isArray(value)) {
1 year ago
let result = "";
for (var val of value) {
result += template(val, ...args);
1 year ago
}
return result;
1 year ago
} else if (typeof template === "function") {
return template(value, ...args);
} else {
return template;
}
};