MCPcopy Index your code
hub / github.com/refined-github/refined-github / addButtonPr

Function addButtonPr

source/features/quick-mention.tsx:76–98  ·  view source on GitHub ↗
(avatar: HTMLElement)

Source from the content-addressed store, hash-verified

74}
75
76function addButtonPr(avatar: HTMLElement): void {
77 const timelineItem = closestElement([
78 // Regular comments
79 '.js-comment-container',
80 // Reviews
81 '.js-comment',
82 ], avatar);
83
84 if (
85 // Exclude events that aren't tall enough, like hidden comments or reviews without comments
86 !elementExists('.unminimized-comment, .js-comment-container', timelineItem)
87 ) {
88 return;
89 }
90
91 // Wrap avatars next to review events so the inserted button doesn't break the layout #4844
92 if (avatar.classList.contains('TimelineItem-avatar')) {
93 avatar.classList.remove('TimelineItem-avatar');
94 wrap(avatar, <div className="avatar-parent-child TimelineItem-avatar d-none d-md-block" />);
95 }
96
97 addButton(avatar);
98}
99
100function addButtonIssue(avatar: HTMLElement): void {
101 const isHidden = !elementExists('.markdown-body', avatar.parentElement!);

Callers

nothing calls this directly

Calls 3

wrapFunction · 0.85
removeMethod · 0.80
addButtonFunction · 0.70

Tested by

no test coverage detected