From: Chris Fulljames Date: Sun, 23 Feb 2025 14:37:10 +0000 (-0500) Subject: Fix bug where confirm dialogs had no effect X-Git-Url: https://littlesong.place/gitweb/?a=commitdiff_plain;h=db4037aee32463feec2fbf8b7b5ddabd6da4edc2;p=littlesongplace.git Fix bug where confirm dialogs had no effect --- diff --git a/static/nav.js b/static/nav.js index 78840dd..101e3e5 100644 --- a/static/nav.js +++ b/static/nav.js @@ -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();