diff options
Diffstat (limited to 'ext/bg/js/handlebars.js')
-rw-r--r-- | ext/bg/js/handlebars.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/bg/js/handlebars.js b/ext/bg/js/handlebars.js index 42b36927..df98bef1 100644 --- a/ext/bg/js/handlebars.js +++ b/ext/bg/js/handlebars.js @@ -43,13 +43,13 @@ function handlebarsMultiLine(options) { return options.fn(this).split('\n').join('<br>'); } -function handlebarsRegister() { - Handlebars.partials = Handlebars.templates; - Handlebars.registerHelper('dumpObject', handlebarsDumpObject); - Handlebars.registerHelper('kanjiLinks', handlebarsKanjiLinks); - Handlebars.registerHelper('multiLine', handlebarsMultiLine); -} - function handlebarsRender(template, data) { + if (Handlebars.partials !== Handlebars.templates) { + Handlebars.partials = Handlebars.templates; + Handlebars.registerHelper('dumpObject', handlebarsDumpObject); + Handlebars.registerHelper('kanjiLinks', handlebarsKanjiLinks); + Handlebars.registerHelper('multiLine', handlebarsMultiLine); + } + return Handlebars.templates[template](data); } |