mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-07 16:19:02 +02:00
4ec437db9e
Migrate B2C js to typescript: contact form, form helpers, and algolia GitOrigin-RevId: b9ec423cdc551123a5b471e4a4c1a482b6a02e16
16 lines
474 B
TypeScript
16 lines
474 B
TypeScript
import { inflightHelper } from '../form-helpers/hydrate-form'
|
|
import { disableElement } from '../utils/disableElement'
|
|
|
|
function setup(el: Element) {
|
|
// Make the element discoverable for multi-submit.
|
|
el.setAttribute('data-ol-disabled-inflight', '')
|
|
|
|
inflightHelper(el as HTMLElement)
|
|
el.addEventListener('click', function () {
|
|
disableElement(el)
|
|
el.dispatchEvent(new Event('pending'))
|
|
})
|
|
}
|
|
|
|
document.querySelectorAll('[data-ol-slow-link]').forEach(setup)
|