Skip to content

Commit 1765602

Browse files
lunnyzeripath
andauthored
Fix reply on code review (#10227)
Co-authored-by: zeripath <[email protected]>
1 parent 9ff4e1d commit 1765602

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
@@ -27,7 +27,8 @@
2727
<span class="markdown-info">{{svg "octicon-markdown" 16}} {{$.root.i18n.Tr "repo.diff.comment.markdown_info"}}</span>
2828
<div class="ui right floated">
2929
{{if $.reply}}
30-
<button name="reply" value="{{$.reply}}" class="ui submit green tiny button btn-reply">{{$.root.i18n.Tr "repo.diff.comment.reply"}}</button>
30+
<input type="hidden" name="reply" value="{{$.reply}}">
31+
<button class="ui submit green tiny button btn-reply" onclick="window.submitReply(this);">{{$.root.i18n.Tr "repo.diff.comment.reply"}}</button>
3132
{{else}}
3233
{{if $.root.CurrentReview}}
3334
<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
@@ -3559,6 +3559,14 @@ window.cancelCodeComment = function (btn) {
35593559
form.closest('.comment-code-cloud').remove();
35603560
}
35613561
};
3562+
3563+
window.submitReply = function (btn) {
3564+
const form = $(btn).closest('form');
3565+
if (form.length > 0 && form.hasClass('comment-form')) {
3566+
form.submit();
3567+
}
3568+
};
3569+
35623570
window.onOAuthLoginClick = function () {
35633571
const oauthLoader = $('#oauth2-login-loader');
35643572
const oauthNav = $('#oauth2-login-navigator');

0 commit comments

Comments
 (0)