diff --git a/app/static/js/modal.js b/app/static/js/modal.js index f5b72b2..911144d 100644 --- a/app/static/js/modal.js +++ b/app/static/js/modal.js @@ -74,8 +74,9 @@ function openDynamicPopup(subitem) { ${alt.name} - + `; + listItem.querySelector('button').addEventListener('click', () => openDynamicPopup(alt)); alternativesList.appendChild(listItem); }); } else { @@ -83,12 +84,13 @@ function openDynamicPopup(subitem) { } // Kopierfunktion für den Identifier - document.getElementById('dynamicCopyButton').addEventListener('click', function () { + const copyButton = document.getElementById('dynamicCopyButton'); + copyButton.onclick = () => { modalContent.select(); navigator.clipboard.writeText(modalContent.value).then(() => { alert('Identifier copied to clipboard!'); }); - }); + }; // Modal anzeigen const modal = new bootstrap.Modal(document.getElementById('dynamicModal'));