mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 18:28:01 +01:00
Fix incorrect link-action event target (#25306)
A regression of #25210 The `e.target` is not "this", eg: `<button link-action><svg></button>`, then `this` should be `button` but `e.target` is `svg`. I will propose a clearer and complete solution for these "link-action" "show-modal" elements after #24724 Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
1ea6b8fd76
commit
695f5d170b
@ -268,10 +268,10 @@ function linkAction(e) {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
// A "link-action" can post AJAX request to its "data-url"
|
// A "link-action" can post AJAX request to its "data-url"
|
||||||
// Then the browser is redirect to: the "redirect" in response, or "data-redirect" attribute, or current URL by reloading.
|
// Then the browser is redirected to: the "redirect" in response, or "data-redirect" attribute, or current URL by reloading.
|
||||||
// If the "link-action" has "data-modal-confirm(-html)" attribute, a confirm modal dialog will be shown before taking action.
|
// If the "link-action" has "data-modal-confirm" attribute, a confirm modal dialog will be shown before taking action.
|
||||||
|
|
||||||
const $this = $(e.target);
|
const $this = $(this);
|
||||||
const redirect = $this.attr('data-redirect');
|
const redirect = $this.attr('data-redirect');
|
||||||
|
|
||||||
const doRequest = () => {
|
const doRequest = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user