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});
|
return utilBackend()._onApiNoteView({noteId});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function apiTemplateRender(template, data, dynamic) {
|
function apiTemplateRender(template, data, dynamic) {
|
||||||
if (dynamic) {
|
return utilBackend()._onApiTemplateRender({template, data, dynamic});
|
||||||
return handlebarsRenderDynamic(template, data);
|
|
||||||
} else {
|
|
||||||
return handlebarsRenderStatic(template, data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function apiCommandExec(command, params) {
|
async function apiCommandExec(command, params) {
|
||||||
|
@ -389,8 +389,12 @@ class Backend {
|
|||||||
return this.anki.guiBrowse(`nid:${noteId}`);
|
return this.anki.guiBrowse(`nid:${noteId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onApiTemplateRender({template, data, dynamic}) {
|
async _onApiTemplateRender({template, data, dynamic}) {
|
||||||
return apiTemplateRender(template, data, dynamic);
|
return (
|
||||||
|
dynamic ?
|
||||||
|
handlebarsRenderDynamic(template, data) :
|
||||||
|
handlebarsRenderStatic(template, data)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_onApiCommandExec({command, params}) {
|
_onApiCommandExec({command, params}) {
|
||||||
|
Loading…
Reference in New Issue
Block a user