Keep sidebar controls in dedicated left rail
This commit is contained in:
+4
-2
@@ -53,6 +53,7 @@ const darkContrastSelect = document.querySelector("#darkContrastSelect");
|
||||
const catalogScreen = document.querySelector(".catalog-screen");
|
||||
const secondaryPanelToggle = document.querySelector("#secondaryPanelToggle");
|
||||
const mainWorkspaceToggle = document.querySelector("#mainWorkspaceToggle");
|
||||
let sidebarUserClosed = false;
|
||||
const nativeFetch = window.fetch.bind(window);
|
||||
window.fetch = (input, init = {}) => {
|
||||
const url = typeof input === "string" ? input : input.url;
|
||||
@@ -225,7 +226,6 @@ lightContrastSelect.addEventListener("change", saveAppearance);
|
||||
darkContrastSelect.addEventListener("change", saveAppearance);
|
||||
loadDatabaseMode();
|
||||
syncSidebarForViewport();
|
||||
window.matchMedia("(min-width: 981px)").addEventListener("change", syncSidebarForViewport);
|
||||
setTimeout(() => {
|
||||
if (manufacturerSelect.value) {
|
||||
loadMappingSources();
|
||||
@@ -852,12 +852,13 @@ function toggleParserDrawer() {
|
||||
parserDrawerToggle.querySelector(".drawer-chevron").textContent = isOpen ? "⌄" : "⌃";
|
||||
}
|
||||
function syncSidebarForViewport() {
|
||||
if (window.matchMedia("(min-width: 981px)").matches)
|
||||
if (window.matchMedia("(min-width: 981px)").matches && !sidebarUserClosed)
|
||||
openSidebar();
|
||||
else
|
||||
closeSidebar();
|
||||
}
|
||||
function openSidebar() {
|
||||
sidebarUserClosed = false;
|
||||
sidebarDrawer.classList.add("is-open");
|
||||
sidebarOverlay.hidden = false;
|
||||
sidebarOpenButton.hidden = true;
|
||||
@@ -866,6 +867,7 @@ function openSidebar() {
|
||||
catalogScreen.classList.remove("sidebar-collapsed");
|
||||
}
|
||||
function closeSidebar() {
|
||||
sidebarUserClosed = true;
|
||||
sidebarDrawer.classList.remove("is-open");
|
||||
sidebarOverlay.hidden = true;
|
||||
sidebarOpenButton.hidden = false;
|
||||
|
||||
Reference in New Issue
Block a user