aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features/contextpopup.js
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/features/contextpopup.js')
-rw-r--r--web_src/js/features/contextpopup.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/web_src/js/features/contextpopup.js b/web_src/js/features/contextpopup.js
index 7b37035547..5c5733b35a 100644
--- a/web_src/js/features/contextpopup.js
+++ b/web_src/js/features/contextpopup.js
@@ -10,17 +10,16 @@ export function initContextPopups() {
}
export function attachRefIssueContextPopup(refIssues) {
- if (!refIssues.length) return;
- refIssues.each(function () {
- if ($(this).hasClass('ref-external-issue')) {
+ for (const refIssue of refIssues) {
+ if (refIssue.classList.contains('ref-external-issue')) {
return;
}
- const {owner, repo, index} = parseIssueHref($(this).attr('href'));
+ const {owner, repo, index} = parseIssueHref(refIssue.getAttribute('href'));
if (!owner) return;
const el = document.createElement('div');
- this.parentNode.insertBefore(el, this.nextSibling);
+ refIssue.parentNode.insertBefore(el, refIssue.nextSibling);
const view = createApp(ContextPopup);
@@ -31,7 +30,7 @@ export function attachRefIssueContextPopup(refIssues) {
el.textContent = 'ContextPopup failed to load';
}
- createTippy(this, {
+ createTippy(refIssue, {
content: el,
placement: 'top-start',
interactive: true,
@@ -40,5 +39,5 @@ export function attachRefIssueContextPopup(refIssues) {
el.firstChild.dispatchEvent(new CustomEvent('ce-load-context-popup', {detail: {owner, repo, index}}));
}
});
- });
+ }
}