fix popover zindex
This commit is contained in:
		
							parent
							
								
									38cff2d670
								
							
						
					
					
						commit
						2a17431460
					
				
					 4 changed files with 23 additions and 19 deletions
				
			
		| 
						 | 
				
			
			@ -38,17 +38,13 @@ export function renderPage(slug: string, componentData: QuartzComponentProps, co
 | 
			
		|||
  const Body = BodyConstructor()
 | 
			
		||||
 | 
			
		||||
  const LeftComponent =
 | 
			
		||||
    <div class="left">
 | 
			
		||||
      <div class="left-inner">
 | 
			
		||||
        {left.map(BodyComponent => <BodyComponent {...componentData} />)}
 | 
			
		||||
      </div>
 | 
			
		||||
    <div class="left sidebar">
 | 
			
		||||
      {left.map(BodyComponent => <BodyComponent {...componentData} />)}
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
  const RightComponent =
 | 
			
		||||
    <div class="right">
 | 
			
		||||
      <div class="right-inner">
 | 
			
		||||
        {right.map(BodyComponent => <BodyComponent {...componentData} />)}
 | 
			
		||||
      </div>
 | 
			
		||||
    <div class="right sidebar">
 | 
			
		||||
      {right.map(BodyComponent => <BodyComponent {...componentData} />)}
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
  const doc = <html>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -274,12 +274,20 @@ async function renderGraph(container: string, slug: string) {
 | 
			
		|||
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)
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -60,6 +60,7 @@ document.addEventListener("nav", async (e: unknown) => {
 | 
			
		|||
 | 
			
		||||
  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 @@ document.addEventListener("nav", async (e: unknown) => {
 | 
			
		|||
    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()
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -145,7 +152,7 @@ document.addEventListener("nav", async (e: unknown) => {
 | 
			
		|||
  searchIcon?.addEventListener("click", showSearch)
 | 
			
		||||
  searchBar?.removeEventListener("input", onType)
 | 
			
		||||
  searchBar?.addEventListener("input", onType)
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  // setup index if it hasn't been already
 | 
			
		||||
  if (!index) {
 | 
			
		||||
    index = new Document({
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue