From 6e6dd4cb0b396ae7ec4f273bccd254bc0f9885d5 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Tue, 03 May 2022 14:57:20 +0000
Subject: [PATCH] fix: trim trailing slash when calculating popover
---
layouts/partials/head.html | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 3b14850..37938a5 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -58,6 +58,7 @@
content,
}))
</script>
+ {{if $.Site.Data.config.enableSPA}}
<script type="module">
import { router, navigate } from "https://unpkg.com/million/dist/router.mjs";
// SPA navigation for access later
@@ -65,7 +66,7 @@
// We only mutate document.title and content within .singlePage element
router(".singlePage");
const callback = () => {
- // requestAnimationFrame()
+ // requestAnimationFrame() delays graph draw until SPA routing is finished
const draw = () => {
const container = document.getElementById("graph-container");
// retry if the graph is not ready
@@ -89,5 +90,8 @@
window.addEventListener("million:navigate", callback);
window.addEventListener("DOMContentLoaded", callback);
</script>
+ {{else}}
+ <script>window.navigate = (url) => window.location.href = url</script>
+ {{end}}
</head>
{{ template "_internal/google_analytics.html" . }}
--
Gitblit v1.10.0