overleaf/services/web/frontend/js/features/contact-form/index.js
Jakob Ackermann 0f594db5a9 Merge pull request #5137 from overleaf/jpa-contact-form-selector
[web] contact-form: swap the element selector for the open form trigger

GitOrigin-RevId: f4d5c437fc2021d7559f5948350c13e5cb847e11
2021-09-24 08:03:30 +00:00

23 lines
615 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()
})
})