From 3c240fc16b17e5d8870cbc7186d8c3f8bf4d2e36 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 9 Jan 2025 16:34:35 +0100 Subject: [PATCH] Solved bug --- app/static/js/modal.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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'));