Remove some inline jquery
authorMagnus Hagander <magnus@hagander.net>
Fri, 5 Sep 2025 14:29:06 +0000 (16:29 +0200)
committerMagnus Hagander <magnus@hagander.net>
Fri, 5 Sep 2025 14:29:06 +0000 (16:29 +0200)
template/confsponsor/sponsor_scanning.html

index 5ac436bf4a543adc6754073412c54c4fe0c96297..40b59b827b9cede18cbe88746c0dad1877bebbb5 100644 (file)
 {%endblock%}
 {%block pagescript%}
 <script language="javascript">
-$(document).ready(function() {
-   $('.confirm-btn').on("click", function(e) {
-      return confirm("Are you sure you want to delete this scan?\nThere is no way to undo!");
-   });
+document.addEventListener('DOMContentLoaded', () => {
+    document.querySelectorAll('.confirm-btn').forEach((b) => {
+        b.addEventListener('click', (e) => {
+            if (!confirm("Are you sure you want to delete this scan?\nThere is no way to undo!")) {
+                e.preventDefault();
+            }
+        });
+    });
 });
 </script>
 {%endblock%}