overleaf/services/web/frontend/js/features/multi-submit/index.js
Jakob Ackermann c9e22f7ddf Merge pull request #5190 from overleaf/jpa-sso-oauth-de-ng
[web] de-ng sso/oauth/institutional account linking pages

GitOrigin-RevId: 50718cefff68142431aa411cb4f8644a3d8ab93f
2021-09-28 08:03:31 +00:00

14 lines
582 B
JavaScript

import { disableElement } from '../utils/disableElement'
document.querySelectorAll('[data-ol-multi-submit]').forEach(el => {
function onSubmit() {
el.querySelectorAll('[data-ol-disabled-inflight]').forEach(disableElement)
}
function setup(childEl) {
childEl.addEventListener('pending', onSubmit)
}
el.querySelectorAll('[data-ol-regular-form]').forEach(setup)
el.querySelectorAll('[data-ol-slow-link]').forEach(setup)
// NOTE: data-ol-async-form is not added explicitly as of now.
// Managing the return to idle is tricky and we can look into that later.
})