summaryrefslogtreecommitdiffstats
path: root/web_src/js/features
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-02-18 04:48:10 +0800
committerGitHub <noreply@github.com>2024-02-17 21:48:10 +0100
commit658cbddbfbe219d5988fcbf308e0d8180176725f (patch)
tree61751ee7dbea93b8ee825463e9f7e4a2feff913b /web_src/js/features
parent5e1bf3efe2ad3ba6cd30db187ca59b94c3fcdafa (diff)
downloadgitea-658cbddbfbe219d5988fcbf308e0d8180176725f.tar.gz
gitea-658cbddbfbe219d5988fcbf308e0d8180176725f.zip
Make submit event code work with both jQuery event and native event (#29223)
Partially related to #29200 and fix other potential bugs. Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'web_src/js/features')
-rw-r--r--web_src/js/features/common-issue-list.js2
-rw-r--r--web_src/js/features/repo-diff.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/web_src/js/features/common-issue-list.js b/web_src/js/features/common-issue-list.js
index 317c11219b..8182f99f29 100644
--- a/web_src/js/features/common-issue-list.js
+++ b/web_src/js/features/common-issue-list.js
@@ -40,7 +40,7 @@ export function initCommonIssueListQuickGoto() {
$form.on('submit', (e) => {
// if there is no goto button, or the form is submitted by non-quick-goto elements, submit the form directly
let doQuickGoto = !isElemHidden($goto);
- const submitter = submitEventSubmitter(e.originalEvent);
+ const submitter = submitEventSubmitter(e);
if (submitter !== $form[0] && submitter !== $input[0] && submitter !== $goto[0]) doQuickGoto = false;
if (!doQuickGoto) return;
diff --git a/web_src/js/features/repo-diff.js b/web_src/js/features/repo-diff.js
index eeb80e91b2..6d6f382613 100644
--- a/web_src/js/features/repo-diff.js
+++ b/web_src/js/features/repo-diff.js
@@ -58,7 +58,7 @@ function initRepoDiffConversationForm() {
const formData = new FormData($form[0]);
// if the form is submitted by a button, append the button's name and value to the form data
- const submitter = submitEventSubmitter(e.originalEvent);
+ const submitter = submitEventSubmitter(e);
const isSubmittedByButton = (submitter?.nodeName === 'BUTTON') || (submitter?.nodeName === 'INPUT' && submitter.type === 'submit');
if (isSubmittedByButton && submitter.name) {
formData.append(submitter.name, submitter.value);