1
0
Fork 0
forked from forgejo/forgejo

Polyfill SubmitEvent for PaleMoon (#28441) (#28478)

Backport #28441 by wxiaoguang

Fix #28319

It only polyfills if there is no "SubmitEvent" class, so it has no side
effect for most users.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
(cherry picked from commit 6af698fb81)
This commit is contained in:
Giteabot 2023-12-15 11:04:37 +08:00 committed by Earl Warren
parent 3c6edfa5e2
commit 2b991b32eb
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
6 changed files with 31 additions and 7 deletions

View file

@ -1,5 +1,5 @@
import $ from 'jquery';
import {isElemHidden, onInputDebounce, toggleElem} from '../utils/dom.js';
import {isElemHidden, onInputDebounce, submitEventSubmitter, toggleElem} from '../utils/dom.js';
import {GET} from '../modules/fetch.js';
const {appSubUrl} = window.config;
@ -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 = e.originalEvent.submitter;
const submitter = submitEventSubmitter(e.originalEvent);
if (submitter !== $form[0] && submitter !== $input[0] && submitter !== $goto[0]) doQuickGoto = false;
if (!doQuickGoto) return;