From 9108bc732191711863914a33e437a1b42475cd88 Mon Sep 17 00:00:00 2001 From: Korbs Date: Tue, 11 Jul 2023 05:42:51 -0400 Subject: [PATCH] Add "Hide" option for Sidebar --- astro/components/Sidebar.astro | 16 ++++++++-------- astro/sidebar.ts | 9 ++++++--- public/scripts/toggle.js | 4 +++- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/astro/components/Sidebar.astro b/astro/components/Sidebar.astro index ae48b8c..239d816 100644 --- a/astro/components/Sidebar.astro +++ b/astro/components/Sidebar.astro @@ -1,9 +1,9 @@ --- import { APP } from '../config' -import { SIDEBARTOP, SIDEBARBOTTOM } from '../sidebar' +import { SIDEBAR, SIDEBARHEADER, SIDEBARTOP, SIDEBARBOTTOM } from '../sidebar' --- -))} \ No newline at end of file diff --git a/astro/sidebar.ts b/astro/sidebar.ts index 49587fa..991f21a 100644 --- a/astro/sidebar.ts +++ b/astro/sidebar.ts @@ -1,7 +1,10 @@ +// Global Sidebar Options +export const SIDEBAR = [{ + hide: false, // Toggle the "Toggle Sidebar" button by default +}] + // Sidebar Header -export const SIDEBARHEADER = [ - // TODO -] +export const SIDEBARHEADER = [] /// Top tabs of your sidbears export const SIDEBARTOP = [ diff --git a/public/scripts/toggle.js b/public/scripts/toggle.js index 837f972..31c985d 100644 --- a/public/scripts/toggle.js +++ b/public/scripts/toggle.js @@ -32,4 +32,6 @@ function ToggleSidebarRe() { document.querySelector("body > div > div.pages").style.left = '280px' document.querySelector("#sidebar-toggle").setAttribute('onclick', 'ToggleSidebar()') -} \ No newline at end of file +} + +setTimeout(() => {if (document.querySelector('.sidebar').getAttribute('id') === 'true') {ToggleSidebar()}else {}}, 0o500) \ No newline at end of file