mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Keep the panel rails still when a tall panel opens
A tall panel moves its stack to the focus or tail layout, and the rail inside the stack went with it, so the Data Layers and Authoring buttons jumped up and the right rail followed. Each layout pass now offsets the rail back to the resting top, with the same transition as the stack, and the right rail lines up with the left rail's buttons. Cyber pins the left stack's top, so it flags that and the rail takes no offset.
This commit is contained in:
1 parent
b20c80e590
commit
06994e0d0e
5 files changed
+48
-3
No files matched your search
@@ -59,6 +59,7 @@ export function layoutLeftPanelRail({
|
||||
stack.style.removeProperty('--left-stack-safe-top');
|
||||
stack.style.removeProperty('--left-stack-safe-bottom');
|
||||
stack.style.removeProperty('--left-stack-centered-height');
|
||||
stack.style.removeProperty('--panel-rail-offset');
|
||||
stack.classList.remove('layout-exclusive');
|
||||
stack.dataset.layoutMode = 'mobile';
|
||||
settleSideAccordion({ panels, enabled: false, onCollapse });
|
||||
@@ -275,6 +276,16 @@ export function layoutLeftPanelRail({
|
||||
) {
|
||||
stack.style.setProperty('--left-stack-safe-bottom', bottomValue);
|
||||
}
|
||||
// The rail stays where the resting stack puts it; only the panels move.
|
||||
// A theme that pins the stack's top (Cyber) leaves nothing to offset.
|
||||
const topPinned =
|
||||
getComputedStyle(stack)
|
||||
.getPropertyValue?.('--panel-stack-top-pinned')
|
||||
?.trim() === '1';
|
||||
const railOffset = `${(topPinned ? 0 : safeTop - layoutTop).toFixed(1)}px`;
|
||||
if (stack.style.getPropertyValue('--panel-rail-offset') !== railOffset) {
|
||||
stack.style.setProperty('--panel-rail-offset', railOffset);
|
||||
}
|
||||
stack.style.removeProperty('--left-stack-centered-height');
|
||||
for (const panel of panels)
|
||||
panel.style.removeProperty('--left-panel-allocated-height');
|
||||
|
||||
Reference in new issue
Block a user