aboutsummaryrefslogtreecommitdiff
path: root/ext/js/templates
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/templates')
-rw-r--r--ext/js/templates/sandbox/anki-template-renderer-content-manager.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/js/templates/sandbox/anki-template-renderer-content-manager.js b/ext/js/templates/sandbox/anki-template-renderer-content-manager.js
index a2573e09..0dabd86e 100644
--- a/ext/js/templates/sandbox/anki-template-renderer-content-manager.js
+++ b/ext/js/templates/sandbox/anki-template-renderer-content-manager.js
@@ -69,4 +69,14 @@ class AnkiTemplateRendererContentManager {
}
this._onUnloadCallbacks = [];
}
+
+ /**
+ * Sets up attributes and events for a link element.
+ * @param {Element} element The link element.
+ * @param {string} href The URL.
+ * @param {boolean} internal Whether or not the URL is an internal or external link.
+ */
+ prepareLink(element, href, internal) {
+ element.href = internal ? '#' : href;
+ }
}