mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 13:24:05 -06:00
Move the hash out of the loop
This commit is contained in:
parent
8081d13872
commit
03e3a0c5f1
@ -85,12 +85,12 @@ async function mouseEnterHandler(
|
|||||||
// prepend all IDs inside popovers to prevent duplicates
|
// prepend all IDs inside popovers to prevent duplicates
|
||||||
html.querySelectorAll("[id]").forEach((el) => {
|
html.querySelectorAll("[id]").forEach((el) => {
|
||||||
const targetID = `popover-${el.id}`
|
const targetID = `popover-${el.id}`
|
||||||
const targetLink = hash.startsWith("#popover")
|
|
||||||
? hash
|
|
||||||
: `#popover-${hash.slice(1).replace("^", "").replace("%5E", "")}`
|
|
||||||
el.id = targetID
|
el.id = targetID
|
||||||
hash = targetLink
|
|
||||||
})
|
})
|
||||||
|
const targetLink = hash.startsWith("#popover")
|
||||||
|
? hash
|
||||||
|
: `#popover-${hash.slice(1).replace("^", "").replace("%5E", "")}`
|
||||||
|
hash = targetLink
|
||||||
const elts = [...html.getElementsByClassName("popover-hint")]
|
const elts = [...html.getElementsByClassName("popover-hint")]
|
||||||
if (elts.length === 0) return
|
if (elts.length === 0) return
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user