summaryrefslogtreecommitdiff
path: root/ext/js/templates
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2021-06-26 17:05:55 -0400
committerGitHub <noreply@github.com>2021-06-26 17:05:55 -0400
commitf9167c8fddbb757d314e1545c9dc788415a1fbf7 (patch)
treee1f1ba1e02a96baac4ae469341e41eb60e1b8ce9 /ext/js/templates
parentf497cb2a07b890d7d4873b5f90c6238d4cb8cb64 (diff)
Template rendering updates (#1762)
* Remove unused function * Update template rendering return value
Diffstat (limited to 'ext/js/templates')
-rw-r--r--ext/js/templates/template-renderer.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/js/templates/template-renderer.js b/ext/js/templates/template-renderer.js
index 07b2849c..e27ad03c 100644
--- a/ext/js/templates/template-renderer.js
+++ b/ext/js/templates/template-renderer.js
@@ -28,6 +28,7 @@ class TemplateRenderer {
this._helpersRegistered = false;
this._stateStack = null;
this._dataTypes = new Map();
+ this._requirements = null;
}
registerDataType(name, {modifier=null, composeData=null}) {
@@ -85,10 +86,14 @@ class TemplateRenderer {
_renderTemplate(instance, data) {
try {
+ const requirements = [];
this._stateStack = [new Map()];
- return instance(data).trim();
+ this._requirements = requirements;
+ const result = instance(data).trim();
+ return {result, requirements};
} finally {
this._stateStack = null;
+ this._requirements = null;
}
}