Skip to content

Commit 5d9651b

Browse files
chore: fix the comment context menu drop down
1 parent d36fece commit 5d9651b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

templates/repo/diff/blob_excerpt.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@
126126
{{template "repo/diff/conversation" dict "." $ "comments" $line.Comments}}
127127
</td>
128128
</tr>
129+
<button class="pull-request-diff-comments hidden"></button>
130+
<script class="pull-request-diff-comments">
131+
var $buttons = document.querySelector('button.pull-request-diff-comments');
132+
if ($buttons) {
133+
$buttons.click();
134+
}
135+
</script>
129136
{{end}}
130137
{{end}}
131138
{{end}}

web_src/js/features/repo-diff.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
import {POST, GET} from '../modules/fetch.ts';
2020
import {fomanticQuery} from '../modules/fomantic/base.ts';
2121
import {createTippy} from '../modules/tippy.ts';
22+
import {initGlobalDropdown} from './common-page.ts';
2223

2324
const {pageData, i18n} = window.config;
2425

@@ -94,6 +95,13 @@ function initRepoDiffConversationForm() {
9495
}
9596
});
9697

98+
$(document).on('click', '.pull-request-diff-comments', async (e) => {
99+
e.preventDefault();
100+
initGlobalDropdown();
101+
// post initiation cleaning up the buttons and scripts
102+
$('.pull-request-diff-comments').remove();
103+
});
104+
97105
$(document).on('click', '.resolve-conversation', async function (e) {
98106
e.preventDefault();
99107
const comment_id = $(this).data('comment-id');

0 commit comments

Comments
 (0)