1
0
mirror of https://github.com/go-gitea/gitea synced 2024-11-14 01:35:54 +01:00

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 <art27@cantab.net>

* Revert unrelated change

* Fix lint

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
Lunny Xiao 2020-02-14 19:53:36 +08:00 committed by GitHub
parent 22dec1cea6
commit e786f098d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

@ -1,6 +1,6 @@
/* globals wipPrefixes, issuesTribute, emojiTribute */ /* globals wipPrefixes, issuesTribute, emojiTribute */
/* exported timeAddManual, toggleStopwatch, cancelStopwatch, initHeatmap */ /* exported timeAddManual, toggleStopwatch, cancelStopwatch, initHeatmap */
/* exported toggleDeadlineForm, setDeadline, deleteDependencyModal, cancelCodeComment, onOAuthLoginClick */ /* exported toggleDeadlineForm, setDeadline, deleteDependencyModal, submitReply, cancelCodeComment, onOAuthLoginClick */
'use strict'; 'use strict';
function htmlEncode(text) { function htmlEncode(text) {
@ -3171,6 +3171,14 @@ function cancelCodeComment(btn) {
form.closest('.comment-code-cloud').remove() form.closest('.comment-code-cloud').remove()
} }
} }
function submitReply(btn) {
const form = $(btn).closest('form');
if (form.length > 0 && form.hasClass('comment-form')) {
form.submit();
}
}
function onOAuthLoginClick() { function onOAuthLoginClick() {
const oauthLoader = $('#oauth2-login-loader'); const oauthLoader = $('#oauth2-login-loader');
const oauthNav = $('#oauth2-login-navigator'); const oauthNav = $('#oauth2-login-navigator');

@ -26,7 +26,8 @@
<span class="markdown-info"><i class="octicon octicon-markdown"></i> {{$.root.i18n.Tr "repo.diff.comment.markdown_info"}}</span> <span class="markdown-info"><i class="octicon octicon-markdown"></i> {{$.root.i18n.Tr "repo.diff.comment.markdown_info"}}</span>
<div class="ui right floated"> <div class="ui right floated">
{{if $.reply}} {{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="submitReply(this);">{{$.root.i18n.Tr "repo.diff.comment.reply"}}</button>
{{else}} {{else}}
{{if $.root.CurrentReview}} {{if $.root.CurrentReview}}
<button name="is_review" value="true" type="submit" <button name="is_review" value="true" type="submit"