Jacky Zhao
2023-07-05 2a17431460770b3375b455815f503781f7448c20
fix popover zindex
4 files modified
36 ■■■■■ changed files
quartz/components/renderPage.tsx 8 ●●●● patch | view | raw | blame | history
quartz/components/scripts/graph.inline.ts 8 ●●●●● patch | view | raw | blame | history
quartz/components/scripts/search.inline.ts 7 ●●●●● patch | view | raw | blame | history
quartz/styles/base.scss 13 ●●●● patch | view | raw | blame | history
quartz/components/renderPage.tsx
@@ -38,18 +38,14 @@
  const Body = BodyConstructor()
  const LeftComponent =
    <div class="left">
      <div class="left-inner">
    <div class="left sidebar">
        {left.map(BodyComponent => <BodyComponent {...componentData} />)}
      </div>
    </div>
  const RightComponent =
    <div class="right">
      <div class="right-inner">
    <div class="right sidebar">
        {right.map(BodyComponent => <BodyComponent {...componentData} />)}
      </div>
    </div>
  const doc = <html>
    <Head {...componentData} />
quartz/components/scripts/graph.inline.ts
@@ -274,12 +274,20 @@
function renderGlobalGraph() {
  const slug = document.body.dataset["slug"]!
  const container = document.getElementById("global-graph-outer")
  const sidebar = container?.closest(".sidebar") as HTMLElement
  container?.classList.add("active")
  if (sidebar) {
    sidebar.style.zIndex = "1"
  }
  renderGraph("global-graph-container", slug)
  function hideGlobalGraph() {
    container?.classList.remove("active")
    const graph = document.getElementById("global-graph-container")
    if (sidebar) {
      sidebar.style.zIndex = "unset"
    }
    if (!graph) return
    removeAllChildren(graph)
  }
quartz/components/scripts/search.inline.ts
@@ -60,6 +60,7 @@
  const data = await fetchData
  const container = document.getElementById("search-container")
  const sidebar = container?.closest(".sidebar") as HTMLElement
  const searchIcon = document.getElementById("search-icon")
  const searchBar = document.getElementById("search-bar") as HTMLInputElement | null
  const results = document.getElementById("results-container")
@@ -69,12 +70,18 @@
    if (searchBar) {
      searchBar.value = "" // clear the input when we dismiss the search
    }
    if (sidebar) {
      sidebar.style.zIndex = "unset"
    }
    if (results) {
      removeAllChildren(results)
    }
  }
  function showSearch() {
    if (sidebar) {
      sidebar.style.zIndex = "1"
    }
    container?.classList.add("active")
    searchBar?.focus()
  }
quartz/styles/base.scss
@@ -89,15 +89,8 @@
      flex-direction: column;
    }
    & .left, & .right {
    & .sidebar {
      flex: 1;
      width: calc(calc(100vw - $pageWidth) / 2);
      @media all and (max-width: $fullPageWidth) {
        width: initial;
      }
    }
    & .left-inner, & .right-inner {
      display: flex;
      flex-direction: column;
      gap: 2rem;
@@ -116,7 +109,7 @@
      }
    }
    & .left-inner {
    & .sidebar.left {
      left: calc(calc(100vw - $pageWidth) / 2 - $sidePanelWidth);
      @media all and (max-width: $fullPageWidth) {
        gap: 1rem;
@@ -124,7 +117,7 @@
      }
    }
    & .right-inner {
    & .sidebar.right {
      right: calc(calc(100vw - $pageWidth) / 2 - $sidePanelWidth);
      & > * {
        @media all and (max-width: $fullPageWidth) {