1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-07 19:17:21 +00:00

Make submit event code work with both jQuery event and native event (#29223) (#29234)

Backport #29223 (no conflict)
This commit is contained in:
wxiaoguang
2024-02-18 14:36:41 +08:00
committed by GitHub
parent 7e0299b4fd
commit d41d367c35
3 changed files with 3 additions and 2 deletions

View File

@ -211,6 +211,7 @@ export function loadElem(el, src) {
const needSubmitEventPolyfill = typeof SubmitEvent === 'undefined';
export function submitEventSubmitter(e) {
e = e.originalEvent ?? e; // if the event is wrapped by jQuery, use "originalEvent", otherwise, use the event itself
return needSubmitEventPolyfill ? (e.target._submitter || null) : e.submitter;
}