git » subscription-tool.git » commit b01e49e

replaced onclick with addEventListener

author Thorsten Ortlepp
2026-04-09 21:12:14 UTC
committer Thorsten Ortlepp
2026-04-09 21:12:14 UTC
parent 1fbc488f9580ade19baf88455e9efde9c2d5c10a

replaced onclick with addEventListener

src/main/resources/static/manage.js +2 -0
src/main/resources/templates/Manage.html +1 -1

diff --git a/src/main/resources/static/manage.js b/src/main/resources/static/manage.js
index 174fa0b..45d1a79 100644
--- a/src/main/resources/static/manage.js
+++ b/src/main/resources/static/manage.js
@@ -1,3 +1,5 @@
+document.getElementById("copybutton").addEventListener("click", copyToClipboard);
+
 function copyToClipboard() {
   var text = document.getElementById("mailto").textContent;
   navigator.clipboard.writeText(text);
diff --git a/src/main/resources/templates/Manage.html b/src/main/resources/templates/Manage.html
index dea9fd1..a730d56 100644
--- a/src/main/resources/templates/Manage.html
+++ b/src/main/resources/templates/Manage.html
@@ -62,7 +62,7 @@
 
   <div class="py-3">
     <pre class="bg-secondary text-white text-wrap lh-lg" id="mailto" th:text="${mails}"/>
-    <p><button class="btn btn-primary btn-sm" onclick="copyToClipboard()" th:text="#{manage.action.copy}"/></p>
+    <p><button class="btn btn-primary btn-sm" id="copybutton" th:text="#{manage.action.copy}"/></p>
   </div>
 
 </div>