mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-21 03:44:05 -06:00
Fix type errors and prettier
This commit is contained in:
parent
43cfbaae22
commit
689b54a945
@ -25,6 +25,7 @@ document.addEventListener("nav", (e: CustomEventMap["nav"]) => {
|
|||||||
```
|
```
|
||||||
|
|
||||||
**When it fires:**
|
**When it fires:**
|
||||||
|
|
||||||
- On initial page load
|
- On initial page load
|
||||||
- On client-side navigation (if SPA routing is enabled)
|
- On client-side navigation (if SPA routing is enabled)
|
||||||
- Does NOT fire on content re-renders
|
- Does NOT fire on content re-renders
|
||||||
@ -50,6 +51,7 @@ document.addEventListener("render", (e: CustomEventMap["render"]) => {
|
|||||||
```
|
```
|
||||||
|
|
||||||
**When it fires:**
|
**When it fires:**
|
||||||
|
|
||||||
- On initial page load (with `document.body` as the container)
|
- On initial page load (with `document.body` as the container)
|
||||||
- When popover content is loaded
|
- When popover content is loaded
|
||||||
- When search results are displayed
|
- When search results are displayed
|
||||||
@ -107,9 +109,11 @@ Always clean up event handlers to prevent memory leaks:
|
|||||||
addRenderListener((container) => {
|
addRenderListener((container) => {
|
||||||
const buttons = container.querySelectorAll(".my-button")
|
const buttons = container.querySelectorAll(".my-button")
|
||||||
|
|
||||||
const handleClick = (e) => { /* ... */ }
|
const handleClick = (e) => {
|
||||||
|
/* ... */
|
||||||
|
}
|
||||||
|
|
||||||
buttons.forEach(button => {
|
buttons.forEach((button) => {
|
||||||
button.addEventListener("click", handleClick)
|
button.addEventListener("click", handleClick)
|
||||||
// Clean up when navigating away
|
// Clean up when navigating away
|
||||||
window.addCleanup(() => {
|
window.addCleanup(() => {
|
||||||
|
|||||||
@ -291,12 +291,6 @@ document.addEventListener("prenav", async () => {
|
|||||||
|
|
||||||
document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
|
document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
|
||||||
const currentSlug = e.detail.url
|
const currentSlug = e.detail.url
|
||||||
const rerender = e.detail.rerender
|
|
||||||
|
|
||||||
// If this is secondary nav call, do not populate explorer again
|
|
||||||
if (rerender) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
await setupExplorer(currentSlug)
|
await setupExplorer(currentSlug)
|
||||||
|
|
||||||
|
|||||||
@ -577,9 +577,6 @@ function cleanupGlobalGraphs() {
|
|||||||
document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
|
document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
|
||||||
const slug = e.detail.url
|
const slug = e.detail.url
|
||||||
|
|
||||||
// if we are rerendering, we can ignore this event
|
|
||||||
if (e.detail.rerender) return
|
|
||||||
|
|
||||||
addToVisited(simplifySlug(slug))
|
addToVisited(simplifySlug(slug))
|
||||||
|
|
||||||
async function renderLocalGraph() {
|
async function renderLocalGraph() {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { computePosition, flip, inline, shift } from "@floating-ui/dom"
|
import { computePosition, flip, inline, shift } from "@floating-ui/dom"
|
||||||
import { FullSlug, normalizeRelativeURLs } from "../../util/path"
|
import { normalizeRelativeURLs } from "../../util/path"
|
||||||
import { fetchCanonical, dispatchRenderEvent, addRenderListener } from "./util"
|
import { fetchCanonical, dispatchRenderEvent, addRenderListener } from "./util"
|
||||||
|
|
||||||
const p = new DOMParser()
|
const p = new DOMParser()
|
||||||
|
|||||||
@ -137,7 +137,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hide the decrypt form when encrypted content appears in popover and search
|
// Hide the decrypt form when encrypted content appears in popover and search
|
||||||
.search-space, .popover {
|
.search-space,
|
||||||
|
.popover {
|
||||||
.encrypted-content .encryption-notice .decrypt-form {
|
.encrypted-content .encryption-notice .decrypt-form {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user