Skip to content

Commit e786f09

Browse files
lunnyzeripathlafriks
authored
Fix reply on code review (#10261)
* Fix branch page pull request title and link error (#10092) * Fix branch page pull request title and link error * Fix ui * Fix reply on code review (#10227) Co-authored-by: zeripath <[email protected]> * Revert unrelated change * Fix lint Co-authored-by: zeripath <[email protected]> Co-authored-by: Lauris BH <[email protected]>
1 parent 22dec1c commit e786f09

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

public/js/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* globals wipPrefixes, issuesTribute, emojiTribute */
22
/* exported timeAddManual, toggleStopwatch, cancelStopwatch, initHeatmap */
3-
/* exported toggleDeadlineForm, setDeadline, deleteDependencyModal, cancelCodeComment, onOAuthLoginClick */
3+
/* exported toggleDeadlineForm, setDeadline, deleteDependencyModal, submitReply, cancelCodeComment, onOAuthLoginClick */
44
'use strict';
55

66
function htmlEncode(text) {
@@ -3171,6 +3171,14 @@ function cancelCodeComment(btn) {
31713171
form.closest('.comment-code-cloud').remove()
31723172
}
31733173
}
3174+
3175+
function submitReply(btn) {
3176+
const form = $(btn).closest('form');
3177+
if (form.length > 0 && form.hasClass('comment-form')) {
3178+
form.submit();
3179+
}
3180+
}
3181+
31743182
function onOAuthLoginClick() {
31753183
const oauthLoader = $('#oauth2-login-loader');
31763184
const oauthNav = $('#oauth2-login-navigator');

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="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"

0 commit comments

Comments
 (0)