fix selectors for explorer

This commit is contained in:
Tejas Sanap 2024-08-11 20:49:20 +01:00
parent 195fc5134c
commit bb6ccfeba8
No known key found for this signature in database
GPG Key ID: DD8C7759CA107D93
2 changed files with 39 additions and 38 deletions

View File

@ -54,9 +54,8 @@ function toggleFolder(evt: MouseEvent) {
} }
function setupExplorer() { function setupExplorer() {
const explorer = document.getElementById("explorer") const buttons = document.querySelectorAll("button#explorer") as NodeListOf<HTMLButtonElement>
if (!explorer) return for (const explorer of buttons) {
if (explorer.dataset.behavior === "collapse") { if (explorer.dataset.behavior === "collapse") {
for (const item of document.getElementsByClassName( for (const item of document.getElementsByClassName(
"folder-button", "folder-button",
@ -101,6 +100,7 @@ function setupExplorer() {
} }
}) })
} }
}
window.addEventListener("resize", setupExplorer) window.addEventListener("resize", setupExplorer)
document.addEventListener("nav", () => { document.addEventListener("nav", () => {

View File

@ -192,6 +192,7 @@ a {
& .sidebar.right { & .sidebar.right {
right: calc(calc(100vw - $pageWidth) / 2 - $sidePanelWidth); right: calc(calc(100vw - $pageWidth) / 2 - $sidePanelWidth);
flex-wrap: wrap; flex-wrap: wrap;
flex-direction: column;
& > * { & > * {
@media all and (max-width: $fullPageWidth) { @media all and (max-width: $fullPageWidth) {
flex: 1; flex: 1;