mirror of
https://github.com/overleaf/overleaf.git
synced 2024-10-31 21:21:03 -04:00
a13dee04c6
[web] add support for async-form inside a multi-submit page GitOrigin-RevId: 801363aeacc6c10411aceaf2c09a5e4b3b90fcf7
15 lines
628 B
JavaScript
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)
|
|
})
|