summaryrefslogtreecommitdiff
path: root/ext/bg/js/handlebars.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-07-29 09:55:54 -0700
committerAlex Yatskov <alex@foosoft.net>2017-07-29 09:55:54 -0700
commitb061cc914210e6c11bc419c38ec850b59d72dd4d (patch)
tree2fa3493fb4a8273a12dee3ddb315da46e36eb1b5 /ext/bg/js/handlebars.js
parentfea35435b22a4eeadbfcc5f29d5f9518700d4306 (diff)
cleanup
Diffstat (limited to 'ext/bg/js/handlebars.js')
-rw-r--r--ext/bg/js/handlebars.js14
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);
}