summaryrefslogtreecommitdiff
path: root/ext/mixed/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed/js')
-rw-r--r--ext/mixed/js/display-generator.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/ext/mixed/js/display-generator.js b/ext/mixed/js/display-generator.js
index 8c39d380..0a57df80 100644
--- a/ext/mixed/js/display-generator.js
+++ b/ext/mixed/js/display-generator.js
@@ -110,10 +110,11 @@ class DisplayGenerator {
}
createTermReason(reason) {
- const node = DisplayGenerator._instantiateTemplate(this._termReasonTemplate);
+ const fragment = DisplayGenerator._instantiateTemplateFragment(this._termReasonTemplate);
+ const node = fragment.querySelector('.term-reason');
node.textContent = reason;
node.dataset.reason = reason;
- return node;
+ return fragment;
}
createTermDefinitionItem(details) {
@@ -378,4 +379,8 @@ class DisplayGenerator {
static _instantiateTemplate(template) {
return document.importNode(template.content.firstChild, true);
}
+
+ static _instantiateTemplateFragment(template) {
+ return document.importNode(template.content, true);
+ }
}