1
0
Fork 0
mirror of https://github.com/overleaf/overleaf.git synced 2024-12-18 18:52:35 -05:00
overleaf/services/web/frontend/js/features/multi-submit/index.js
Jakob Ackermann a13dee04c6 Merge pull request from overleaf/jpa-multi-submit-async-form
[web] add support for async-form inside a multi-submit page

GitOrigin-RevId: 801363aeacc6c10411aceaf2c09a5e4b3b90fcf7
2022-01-26 09:02:55 +00:00

15 lines
628 B
JavaScript

import { disableElement, enableElement } from '../utils/disableElement'
document.querySelectorAll('[data-ol-multi-submit]').forEach(el => {
function setup(childEl) {
childEl.addEventListener('pending', () => {
el.querySelectorAll('[data-ol-disabled-inflight]').forEach(disableElement)
})
childEl.addEventListener('idle', () => {
el.querySelectorAll('[data-ol-disabled-inflight]').forEach(enableElement)
})
}
el.querySelectorAll('[data-ol-async-form]').forEach(setup)
el.querySelectorAll('[data-ol-regular-form]').forEach(setup)
el.querySelectorAll('[data-ol-slow-link]').forEach(setup)
})