mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 23:04:05 -06:00
Prefer compatibility
This commit is contained in:
parent
9786ead130
commit
e31527ac74
@ -149,11 +149,14 @@ function toggleExplorerFolders() {
|
|||||||
/\/index$/g,
|
/\/index$/g,
|
||||||
"",
|
"",
|
||||||
)
|
)
|
||||||
const listToReplace = document.querySelectorAll(".folder-outer:has(> ul[data-folderul]")
|
const allFolders = document.querySelectorAll(".folder-outer")
|
||||||
|
|
||||||
listToReplace.forEach((element) => {
|
allFolders.forEach((element) => {
|
||||||
if (element.children.length > 0) {
|
const folderUl = Array.from(element.children).find((child) =>
|
||||||
if (currentFile.includes(element.firstElementChild?.getAttribute("data-folderul") ?? "")) {
|
child.matches("ul[data-folderul]"),
|
||||||
|
)
|
||||||
|
if (folderUl) {
|
||||||
|
if (currentFile.includes(folderUl.getAttribute("data-folderul") ?? "")) {
|
||||||
if (!element.classList.contains("open")) {
|
if (!element.classList.contains("open")) {
|
||||||
element.classList.add("open")
|
element.classList.add("open")
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user