From 08370e40aba2d95c48b755daffe3d6c974bc951d Mon Sep 17 00:00:00 2001 From: "aiyion.prime" Date: Sun, 5 Jan 2025 16:23:40 +0100 Subject: [PATCH] feat: Enable toggling for anchor setting upon clicking page-intern links. This comes in handy when anchors are not wanted. Currently our htmx deployment is such a situation. --- js/grayscale.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/grayscale.js b/js/grayscale.js index a6ecce6..de532b2 100644 --- a/js/grayscale.js +++ b/js/grayscale.js @@ -36,6 +36,9 @@ document.addEventListener("DOMContentLoaded", function () { top: targetElement.offsetTop, behavior: "smooth", }); + if (link.classList.contains("nohref")) { + return; + } window.location.href = href; } });