Skip to content

Commit

Permalink
Fix reply on code review (go-gitea#10227)
Browse files Browse the repository at this point in the history
Co-authored-by: zeripath <[email protected]>
  • Loading branch information
lunny and zeripath committed Feb 13, 2020
1 parent 5cdfde2 commit 1c24b05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion templates/repo/diff/comment_form.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<span class="markdown-info"><i class="octicon octicon-markdown"></i> {{$.root.i18n.Tr "repo.diff.comment.markdown_info"}}</span>
<div class="ui right floated">
{{if $.reply}}
<button name="reply" value="{{$.reply}}" class="ui submit green tiny button btn-reply">{{$.root.i18n.Tr "repo.diff.comment.reply"}}</button>
<input type="hidden" name="reply" value="{{$.reply}}">
<button class="ui submit green tiny button btn-reply" onclick="window.submitReply(this);">{{$.root.i18n.Tr "repo.diff.comment.reply"}}</button>
{{else}}
{{if $.root.CurrentReview}}
<button name="is_review" value="true" type="submit"
Expand Down
8 changes: 8 additions & 0 deletions web_src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3557,6 +3557,14 @@ window.cancelCodeComment = function (btn) {
form.closest('.comment-code-cloud').remove();
}
};

window.submitReply = function (btn) {
const form = $(btn).closest('form');
if (form.length > 0 && form.hasClass('comment-form')) {
form.submit();
}
};

window.onOAuthLoginClick = function () {
const oauthLoader = $('#oauth2-login-loader');
const oauthNav = $('#oauth2-login-navigator');
Expand Down

0 comments on commit 1c24b05

Please sign in to comment.