Anton Bulakh
2025-01-24 4e4930ef9c2e2ddb9bcb1436660d3a3002c19844
quartz/components/scripts/graph.inline.ts
@@ -550,6 +550,19 @@
  addToVisited(simplifySlug(slug))
  await renderGraph("graph-container", slug)
  // Function to re-render the graph when the theme changes
  const handleThemeChange = () => {
    renderGraph("graph-container", slug)
  }
  // event listener for theme change
  document.addEventListener("themechange", handleThemeChange)
  // cleanup for the event listener
  window.addCleanup(() => {
    document.removeEventListener("themechange", handleThemeChange)
  })
  const container = document.getElementById("global-graph-outer")
  const sidebar = container?.closest(".sidebar") as HTMLElement
@@ -567,7 +580,7 @@
  function hideGlobalGraph() {
    container?.classList.remove("active")
    if (sidebar) {
      sidebar.style.zIndex = "unset"
      sidebar.style.zIndex = ""
    }
  }