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');
|
2025-01-09 14:59:30 +01:00
|
|
|
modalContent.value = subitem.identifier;
|
2025-01-08 18:06:08 +01:00
|
|
|
|
|
|
|
// 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();
|
|
|
|
}
|