Fix suggestions for issues (#32380)

This commit is contained in:
wxiaoguang authored and GitHub committed 2024-10-30 20:06:36 +00:00
1 parent f4d3aaeeb9
commit a4a121c684
11 files changed
+82 -88

No files matched your search

+4 -6
View File
@@ -10,12 +10,10 @@ export function initContextPopups() {
export function attachRefIssueContextPopup(refIssues) {
for (const refIssue of refIssues) {
if (refIssue.classList.contains('ref-external-issue')) {
return;
}
if (refIssue.classList.contains('ref-external-issue')) continue;
const {owner, repo, index} = parseIssueHref(refIssue.getAttribute('href'));
if (!owner) return;
const issuePathInfo = parseIssueHref(refIssue.getAttribute('href'));
if (!issuePathInfo.ownerName) continue;
const el = document.createElement('div');
el.classList.add('tw-p-3');
@@ -38,7 +36,7 @@ export function attachRefIssueContextPopup(refIssues) {
role: 'dialog',
interactiveBorder: 5,
onShow: () => {
el.firstChild.dispatchEvent(new CustomEvent('ce-load-context-popup', {detail: {owner, repo, index}}));
el.firstChild.dispatchEvent(new CustomEvent('ce-load-context-popup', {detail: issuePathInfo}));
},
});
}