mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-21 14:38:24 +02:00
Add button to update notes
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
function initModal(target, url, content_id = 'form-content') {
|
||||
document.querySelector('[data-bs-target="#' + target + 'Modal"]').addEventListener('click', () => {
|
||||
document.querySelectorAll('[data-bs-target="#' + target + 'Modal"]')
|
||||
.forEach(elem => elem.addEventListener('click', () => {
|
||||
let modalBody = document.querySelector("#" + target + "Modal div.modal-body")
|
||||
|
||||
if (!modalBody.innerHTML.trim()) {
|
||||
@ -11,5 +12,5 @@ function initModal(target, url, content_id = 'form-content') {
|
||||
.then(res => modalBody.innerHTML = res.getElementById(content_id).outerHTML)
|
||||
.then(() => $('.selectpicker').selectpicker()) // TODO Update that when the library will be JQuery-free
|
||||
}
|
||||
})
|
||||
}))
|
||||
}
|
||||
|
Reference in New Issue
Block a user