loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

wxiaoguang
Giteabot
and committed by
GitHub
695f5d17 1ea6b8fd

+3 -3
+3 -3
web_src/js/features/common-global.js
··· 268 268 e.preventDefault(); 269 269 270 270 // A "link-action" can post AJAX request to its "data-url" 271 - // Then the browser is redirect to: the "redirect" in response, or "data-redirect" attribute, or current URL by reloading. 272 - // If the "link-action" has "data-modal-confirm(-html)" attribute, a confirm modal dialog will be shown before taking action. 271 + // Then the browser is redirected to: the "redirect" in response, or "data-redirect" attribute, or current URL by reloading. 272 + // If the "link-action" has "data-modal-confirm" attribute, a confirm modal dialog will be shown before taking action. 273 273 274 - const $this = $(e.target); 274 + const $this = $(this); 275 275 const redirect = $this.attr('data-redirect'); 276 276 277 277 const doRequest = () => {