feat(explorer): Add active class to current folder in explorer

This commit is contained in:
Emile Bangma 2025-11-06 21:40:15 +01:00 committed by GitHub
parent 86a30ad150
commit 51bfc8f9e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -111,6 +111,10 @@ function createFolderNode(
const folderPath = node.slug const folderPath = node.slug
folderContainer.dataset.folderpath = folderPath folderContainer.dataset.folderpath = folderPath
if (currentSlug === folderPath) {
folderContainer.classList.add("active")
}
if (opts.folderClickBehavior === "link") { if (opts.folderClickBehavior === "link") {
// Replace button with link for link behavior // Replace button with link for link behavior
const button = titleContainer.querySelector(".folder-button") as HTMLElement const button = titleContainer.querySelector(".folder-button") as HTMLElement