]> littlesong.place Git - littlesongplace.git/commitdiff
Fix bug where confirm dialogs had no effect
authorChris Fulljames <christianfulljames@gmail.com>
Sun, 23 Feb 2025 14:37:10 +0000 (09:37 -0500)
committerChris Fulljames <christianfulljames@gmail.com>
Sun, 23 Feb 2025 14:37:10 +0000 (09:37 -0500)
static/nav.js

index 78840dd337feae8b9f93b234a5036f59772c7dfa..101e3e5e1bf356b29655f3817458a2327ab8f64d 100644 (file)
@@ -36,6 +36,9 @@ document.addEventListener("DOMContentLoaded", (e) => {
 });
 
 function onLinkClick(event) {
+    if (event.defaultPrevented) {
+        return;
+    }
     var targetUrl = new URL(event.currentTarget.href);
     if (urlIsOnSameSite(targetUrl)) {
         event.preventDefault();
@@ -45,6 +48,9 @@ function onLinkClick(event) {
 }
 
 function onFormSubmit(event) {
+    if (event.defaultPrevented) {
+        return;
+    }
     var targetUrl = new URL(event.target.action);
     if (urlIsOnSameSite(targetUrl)) {
         event.preventDefault();