homepage.veen.world/app/static/js/dynamic-modal.js

18 lines
721 B
JavaScript
Raw Normal View History

2025-01-08 18:06:08 +01:00
function openDynamicPopup(subitem) {
// Set modal title and content
document.getElementById('dynamicModalLabel').innerText = subitem.description;
const modalContent = document.getElementById('dynamicModalContent');
modalContent.value = subitem.address;
// Add copy functionality
document.getElementById('dynamicCopyButton').addEventListener('click', function () {
modalContent.select();
navigator.clipboard.writeText(modalContent.value)
.then(() => alert('Content copied to clipboard!'))
.catch(() => alert('Failed to copy content.'));
});
// Show the modal
const modal = new bootstrap.Modal(document.getElementById('dynamicModal'));
modal.show();
}