summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsiikamiika <siikamiika@users.noreply.github.com>2020-02-10 21:56:48 +0200
committersiikamiika <siikamiika@users.noreply.github.com>2020-02-10 21:56:48 +0200
commit4f1ed14f07c1373bc5734a12bbb3203c1b07a2bd (patch)
tree0f1eae1583c4a31a50aaf92c88d66d635005bbe9
parentb7f347ff4f18a7f64267eb0d1ba1b84cbdfc4220 (diff)
simplify TemplateHandler
-rw-r--r--ext/mixed/js/template-handler.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/ext/mixed/js/template-handler.js b/ext/mixed/js/template-handler.js
index 86e2414f..a5a62937 100644
--- a/ext/mixed/js/template-handler.js
+++ b/ext/mixed/js/template-handler.js
@@ -20,15 +20,9 @@
class TemplateHandler {
constructor(html) {
this._templates = new Map();
- this._html = html;
- this._doc = null;
- this._initialize();
- }
-
- _initialize() {
- this._doc = new DOMParser().parseFromString(this._html, 'text/html');
- for (const template of this._doc.querySelectorAll('template')) {
+ const doc = new DOMParser().parseFromString(html, 'text/html');
+ for (const template of doc.querySelectorAll('template')) {
this._setTemplate(template);
}
}