mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-12 19:44:51 -05:00
15 lines
582 B
JavaScript
15 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.
|
||
|
})
|