From c8d390dbc5a749af533f1ec05de2d5b6f37fa156 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Thu, 28 Apr 2022 20:45:29 +0000
Subject: [PATCH] fix: always hide popover on mobile (fixes #104)

---
 assets/js/graph.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/assets/js/graph.js b/assets/js/graph.js
index 6a63024..08c97e9 100644
--- a/assets/js/graph.js
+++ b/assets/js/graph.js
@@ -127,7 +127,7 @@
     .attr("fill", color)
     .style("cursor", "pointer")
     .on("click", (_, d) => {
-      window.location.href = baseUrl + '/' + decodeURI(d.id).replace(/\s+/g, '-')
+      window.location.href = `${baseUrl}/${decodeURI(d.id).replace(/\s+/g, '-')}/`
     })
     .on("mouseover", function(_, d) {
       d3.selectAll(".node")
@@ -185,7 +185,7 @@
   const labels = graphNode.append("text")
     .attr("dx", 12)
     .attr("dy", ".35em")
-    .text((d) => content[decodeURI(d.id).replace(/\s+/g, '-')]?.title || d.id.replace("-", " "))
+    .text((d) => content[d.id]?.title || d.id.replace("-", " "))
     .style("opacity", 0)
     .style("pointer-events", "none")
     .call(drag(simulation));

--
Gitblit v1.10.0