From 3943ba49b6e04f225318384222871899699bedd9 Mon Sep 17 00:00:00 2001 From: Yasen Pramatarov Date: Wed, 7 Aug 2024 17:41:56 +0300 Subject: [PATCH] Fixes sidebar collapsing --- public_html/static/all.css | 40 ++++++++------------------- public_html/static/sidebar.js | 1 + public_html/templates/page-header.php | 11 +++++++- 3 files changed, 22 insertions(+), 30 deletions(-) diff --git a/public_html/static/all.css b/public_html/static/all.css index cdd5542..0819941 100644 --- a/public_html/static/all.css +++ b/public_html/static/all.css @@ -78,31 +78,6 @@ color: white; } -/* -.results { - margin-bottom: 50px; -} - -.results table { - width: 100%; - border-collapse: collapse; - margin: 20px 0; -} -.results table, th, td { - border: 1px solid #ddd; -} -.results th, td { - padding: 8px; - text-align: left; -} -.results th { - background-color: #f2f2f2; -} -.results p { - text-align: center; -} -*/ - .results-header { display: flex; justify-content: space-between; @@ -126,7 +101,7 @@ .toggle-sidebar-button { position: absolute; top: -10px; - left: 0; + right: -10px; z-index: 100; margin: 10px; height: 22px; @@ -143,6 +118,9 @@ .sidebar-wrapper.collapsed { width: 3em; } +.sidebar-collapsed .sidebar-wrapper { + width: 3em; +} .sidebar-content { width: 250px; border: none; @@ -153,11 +131,15 @@ } .main-content { - transition: width: 0.5s ease; - width: 80%; /* 75% */ + flex-grow: 1; + transition: width 0.5s ease; + width: 80%; } .main-content.expanded { - width: 95%; /* none */ + width: calc(70% + 250px); +} +.sidebar-collapsed .main-content { + width: calc(70% + 3em); } .logo { diff --git a/public_html/static/sidebar.js b/public_html/static/sidebar.js index d1ed7b9..6da0401 100644 --- a/public_html/static/sidebar.js +++ b/public_html/static/sidebar.js @@ -32,6 +32,7 @@ document.addEventListener('DOMContentLoaded', function () { toggleButton.addEventListener('click', function () { // toggle sidebar and main content sidebar.classList.toggle('collapsed'); + document.documentElement.classList.toggle('sidebar-collapsed'); mainContent.classList.toggle('expanded'); // Toggle the value between ">>" and "<<" if (toggleButton.value === ">>") { diff --git a/public_html/templates/page-header.php b/public_html/templates/page-header.php index 3c8e56b..1a89dac 100644 --- a/public_html/templates/page-header.php +++ b/public_html/templates/page-header.php @@ -7,7 +7,16 @@ - + + Jilo Web