mirror of
https://github.com/beatriceo/polyglot.git
synced 2025-10-25 18:52:11 +00:00
fixed issue where calling modal was only appeared for the first contact in list
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
const triggerModalEvent = () => {
|
||||
const btn = document.getElementById("modalTrigger");
|
||||
const modal = document.getElementById("myModal");
|
||||
|
||||
if (btn) {
|
||||
btn.addEventListener('click', function(event) {
|
||||
$('#myModal').modal('show');
|
||||
});
|
||||
}
|
||||
const buttons = document.querySelectorAll(".modalTrigger");
|
||||
|
||||
buttons.forEach(btn => {
|
||||
if (btn) {
|
||||
btn.addEventListener('click', function(event) {
|
||||
const btnId = btn.getAttribute('data-user-id')
|
||||
$("#myModal"+`${btnId}`).modal('show');
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export { triggerModalEvent }
|
||||
|
||||
Reference in New Issue
Block a user