overleaf/services/web/frontend/js/features/link-helpers/slow-link.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

15 lines
450 B
JavaScript

import { inflightHelper } from '../form-helpers/hydrate-form'
import { disableElement } from '../utils/disableElement'
function setup(el) {
// Make the element discoverable for multi-submit.
el.setAttribute('data-ol-disabled-inflight', '')
inflightHelper(el)
el.addEventListener('click', function () {
disableElement(el)
el.dispatchEvent(new Event('pending'))
})
}
document.querySelectorAll('[data-ol-slow-link]').forEach(setup)