summaryrefslogtreecommitdiff
path: root/ext/bg/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js')
-rw-r--r--ext/bg/js/api.js8
-rw-r--r--ext/bg/js/backend.js8
2 files changed, 8 insertions, 8 deletions
diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js
index 9de1fb4b..f4818854 100644
--- a/ext/bg/js/api.js
+++ b/ext/bg/js/api.js
@@ -61,12 +61,8 @@ function apiNoteView(noteId) {
return utilBackend()._onApiNoteView({noteId});
}
-async function apiTemplateRender(template, data, dynamic) {
- if (dynamic) {
- return handlebarsRenderDynamic(template, data);
- } else {
- return handlebarsRenderStatic(template, data);
- }
+function apiTemplateRender(template, data, dynamic) {
+ return utilBackend()._onApiTemplateRender({template, data, dynamic});
}
async function apiCommandExec(command, params) {
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 4db88365..38dbd0f1 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -389,8 +389,12 @@ class Backend {
return this.anki.guiBrowse(`nid:${noteId}`);
}
- _onApiTemplateRender({template, data, dynamic}) {
- return apiTemplateRender(template, data, dynamic);
+ async _onApiTemplateRender({template, data, dynamic}) {
+ return (
+ dynamic ?
+ handlebarsRenderDynamic(template, data) :
+ handlebarsRenderStatic(template, data)
+ );
}
_onApiCommandExec({command, params}) {