import { FolderState } from "../ExplorerNode" // Current state of folders let explorerState: FolderState[] const observer = new IntersectionObserver((entries) => { // If last element is observed, remove gradient of "overflow" class so element is visible const explorer = document.getElementById("explorer-ul") for (const entry of entries) { if (entry.isIntersecting) { explorer?.classList.add("no-background") } else { explorer?.classList.remove("no-background") } } }) function toggleExplorer(this: HTMLElement) { // Toggle collapsed state of entire explorer this.classList.toggle("collapsed") const content = this.nextElementSibling as HTMLElement content.classList.toggle("collapsed") content.style.maxHeight = content.style.maxHeight === "0px" ? content.scrollHeight + "px" : "0px" } function toggleFolder(evt: MouseEvent) { evt.stopPropagation() // Element that was clicked const target = evt.target as HTMLElement // Check if target was svg icon or button const isSvg = target.nodeName === "svg" // corresponding