Fix strange UI behavior of cancelling dismiss review modal (#25172)

Backport clean cherry-picks of
https://github.com/go-gitea/gitea/pull/25133 and
https://github.com/go-gitea/gitea/pull/25162 to 1.20.
pull/25197/head^2
silverwind 2 years ago committed by GitHub
parent ee26d1c578
commit 224ee0d4e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      templates/repo/issue/view_content/sidebar.tmpl
  2. 7
      web_src/js/features/repo-issue.js

@ -58,10 +58,10 @@
</div> </div>
<div class="gt-df gt-ac gt-gap-3"> <div class="gt-df gt-ac gt-gap-3">
{{if (and $.Permission.IsAdmin (or (eq .Review.Type 1) (eq .Review.Type 3)) (not $.Issue.IsClosed))}} {{if (and $.Permission.IsAdmin (or (eq .Review.Type 1) (eq .Review.Type 3)) (not $.Issue.IsClosed))}}
<a href="#" class="ui muted icon gt-df gt-ac dismiss-review-btn" data-review-id="dismiss-review-{{.Review.ID}}" data-tooltip-content="{{$.locale.Tr "repo.issues.dismiss_review"}}"> <a href="#" class="ui muted icon gt-df gt-ac show-modal" data-tooltip-content="{{$.locale.Tr "repo.issues.dismiss_review"}}" data-modal="#dismiss-review-modal-{{.Review.ID}}">
{{svg "octicon-x" 20}} {{svg "octicon-x" 20}}
</a> </a>
<div class="ui small modal" id="dismiss-review-modal"> <div class="ui small modal" id="dismiss-review-modal-{{.Review.ID}}">
<div class="header"> <div class="header">
{{$.locale.Tr "repo.issues.dismiss_review"}} {{$.locale.Tr "repo.issues.dismiss_review"}}
</div> </div>

@ -358,13 +358,6 @@ export function initRepoIssueComments() {
).then(() => window.location.reload()); ).then(() => window.location.reload());
}); });
$('.dismiss-review-btn').on('click', function (e) {
e.preventDefault();
const $this = $(this);
const $dismissReviewModal = $this.next();
$dismissReviewModal.modal('show');
});
$(document).on('click', (event) => { $(document).on('click', (event) => {
const urlTarget = $(':target'); const urlTarget = $(':target');
if (urlTarget.length === 0) return; if (urlTarget.length === 0) return;

Loading…
Cancel
Save