Skip to content

Commit 987cd27

Browse files
lunnyzeripath
andauthored
Fix reply on code review (#10227) (#10257)
Co-authored-by: zeripath <[email protected]> Co-authored-by: zeripath <[email protected]>
1 parent 5cdfde2 commit 987cd27

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

templates/repo/diff/comment_form.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
<span class="markdown-info"><i class="octicon octicon-markdown"></i> {{$.root.i18n.Tr "repo.diff.comment.markdown_info"}}</span>
2727
<div class="ui right floated">
2828
{{if $.reply}}
29-
<button name="reply" value="{{$.reply}}" class="ui submit green tiny button btn-reply">{{$.root.i18n.Tr "repo.diff.comment.reply"}}</button>
29+
<input type="hidden" name="reply" value="{{$.reply}}">
30+
<button class="ui submit green tiny button btn-reply" onclick="window.submitReply(this);">{{$.root.i18n.Tr "repo.diff.comment.reply"}}</button>
3031
{{else}}
3132
{{if $.root.CurrentReview}}
3233
<button name="is_review" value="true" type="submit"

web_src/js/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3557,6 +3557,14 @@ window.cancelCodeComment = function (btn) {
35573557
form.closest('.comment-code-cloud').remove();
35583558
}
35593559
};
3560+
3561+
window.submitReply = function (btn) {
3562+
const form = $(btn).closest('form');
3563+
if (form.length > 0 && form.hasClass('comment-form')) {
3564+
form.submit();
3565+
}
3566+
};
3567+
35603568
window.onOAuthLoginClick = function () {
35613569
const oauthLoader = $('#oauth2-login-loader');
35623570
const oauthNav = $('#oauth2-login-navigator');

0 commit comments

Comments
 (0)