Skip to content

Commit c5daf0b

Browse files
committed
alignment
1 parent 343d03e commit c5daf0b

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

content.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
button.style.marginLeft = '8px';
2525
button.style.verticalAlign = 'middle';
2626
button.innerHTML = `
27-
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" style="display:inline-block;vertical-align:text-bottom;">
27+
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" style="display:inline-block;vertical-align:middle;margin-right:4px;">
2828
<path fill="currentColor" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Zm5.22-1.72a.75.75 0 0 1 1.06 0l3.97 3.97V4.25a.75.75 0 0 1 1.5 0v6.5a.75.75 0 0 1-.75.75h-6.5a.75.75 0 0 1 0-1.5H9.44L5.47 5.53a.75.75 0 0 1 0-1.06Z"></path>
2929
</svg>
3030
Copy PR Link
@@ -76,12 +76,18 @@
7676
}
7777
});
7878

79-
// Insert button next to title
79+
// Insert button after the PR number
8080
const titleContainer = titleElement.parentElement;
8181
if (titleContainer) {
8282
titleContainer.style.display = 'flex';
8383
titleContainer.style.alignItems = 'center';
84-
titleElement.after(button);
84+
// Find the PR number element (span with issue number after title)
85+
const prNumberElement = titleContainer.querySelector('.gh-header-number');
86+
if (prNumberElement) {
87+
prNumberElement.after(button);
88+
} else {
89+
titleElement.after(button);
90+
}
8591
return true;
8692
}
8793

0 commit comments

Comments
 (0)