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 | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/assets/js/graph.js b/assets/js/graph.js
index c6c8718..08c97e9 100644
--- a/assets/js/graph.js
+++ b/assets/js/graph.js
@@ -127,9 +127,9 @@
.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) {
+ .on("mouseover", function(_, d) {
d3.selectAll(".node")
.transition()
.duration(100)
@@ -159,7 +159,7 @@
.transition()
.duration(200)
.style("opacity", 1)
- }).on("mouseleave", function (_, d) {
+ }).on("mouseleave", function(_, d) {
d3.selectAll(".node")
.transition()
.duration(200)
@@ -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 || "Untitled")
+ .text((d) => content[d.id]?.title || d.id.replace("-", " "))
.style("opacity", 0)
.style("pointer-events", "none")
.call(drag(simulation));
--
Gitblit v1.10.0