Skip to content

Commit

Permalink
Prefer compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
saberzero1 committed Feb 1, 2025
1 parent 9786ead commit e31527a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions quartz/components/scripts/explorer.inline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,14 @@ function toggleExplorerFolders() {
/\/index$/g,
"",
)
const listToReplace = document.querySelectorAll(".folder-outer:has(> ul[data-folderul]")

listToReplace.forEach((element) => {
if (element.children.length > 0) {
if (currentFile.includes(element.firstElementChild?.getAttribute("data-folderul") ?? "")) {
const allFolders = document.querySelectorAll(".folder-outer")

allFolders.forEach((element) => {
const folderUl = Array.from(element.children).find((child) =>
child.matches("ul[data-folderul]"),
)
if (folderUl) {
if (currentFile.includes(folderUl.getAttribute("data-folderul") ?? "")) {
if (!element.classList.contains("open")) {
element.classList.add("open")
}
Expand Down

0 comments on commit e31527a

Please sign in to comment.