summaryrefslogtreecommitdiff
path: root/ext/bg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-02 22:19:55 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-02 22:19:55 -0500
commit774db569eb3746e8d0fe44325d76e4040196263a (patch)
tree08106e8b30f43ad00e5d4921085343cd729f0fcb /ext/bg
parent5339381c30316c49e971fa5ba4ef2050ed96f96f (diff)
Simplify ankiGetFieldMarkersHtml
Diffstat (limited to 'ext/bg')
-rw-r--r--ext/bg/js/settings/anki.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/bg/js/settings/anki.js b/ext/bg/js/settings/anki.js
index 3cea4da7..e1aabbaf 100644
--- a/ext/bg/js/settings/anki.js
+++ b/ext/bg/js/settings/anki.js
@@ -178,11 +178,9 @@ function ankiFieldsToDict(elements) {
}
-function ankiGetFieldMarkersHtml(markers, fragment) {
+function ankiGetFieldMarkersHtml(markers) {
const template = document.querySelector('#anki-field-marker-template').content;
- if (!fragment) {
- fragment = new DocumentFragment();
- }
+ const fragment = document.createDocumentFragment();
for (const marker of markers) {
const markerNode = document.importNode(template, true).firstChild;
markerNode.querySelector('.marker-link').textContent = marker;