Move apiTemplateRender implementation into Backend
This commit is contained in:
parent
5a74350552
commit
f07207c9bf
@ -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) {
|
||||
|
@ -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}) {
|
||||
|
Loading…
Reference in New Issue
Block a user