mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-12 03:55:28 -05:00
9f86f90a08
[web][website-redesign] General contact form redesign GitOrigin-RevId: f5f3a37fea69afb48a37b263695c958e6753e095
35 lines
990 B
JavaScript
35 lines
990 B
JavaScript
import { setupSearch } from './search'
|
|
|
|
document
|
|
.querySelectorAll('[data-ol-contact-form-with-search]')
|
|
.forEach(setupSearch)
|
|
|
|
document
|
|
.querySelectorAll('[data-ol-open-contact-form-modal="contact-us"]')
|
|
.forEach(el => {
|
|
el.addEventListener('click', function (e) {
|
|
e.preventDefault()
|
|
$('[data-ol-contact-form-modal="contact-us"]').modal()
|
|
})
|
|
})
|
|
|
|
document
|
|
.querySelectorAll('[data-ol-open-contact-form-modal="general"]')
|
|
.forEach(el => {
|
|
el.addEventListener('click', function (e) {
|
|
e.preventDefault()
|
|
$('[data-ol-contact-form-modal="general"]').modal()
|
|
})
|
|
})
|
|
|
|
document.querySelectorAll('[data-ol-contact-form').forEach(el => {
|
|
el.addEventListener('submit', function (e) {
|
|
const emailValue = document.querySelector(
|
|
'[data-ol-contact-form-email-input]'
|
|
).value
|
|
const thankYouEmailEl = document.querySelector(
|
|
'[data-ol-contact-form-thank-you-email]'
|
|
)
|
|
thankYouEmailEl.textContent = emailValue
|
|
})
|
|
})
|