Refactor ZenCompactMode styles for consistent sidebar positioning and update animation parameters

This commit is contained in:
mr. M
2025-02-05 21:22:20 +01:00
parent 5e25b0ade9
commit 5937338348
2 changed files with 9 additions and 13 deletions

View File

@@ -63,7 +63,7 @@
}
&:not([zen-right-side='true']) #navigator-toolbox {
left: calc(-1 * var(--zen-sidebar-width) + var(--zen-element-separation));
left: calc(-1 * var(--zen-sidebar-width) + 1px);
}
/* When we have multiple toolbars and the top-toolbar is NOT being hidden,
@@ -80,7 +80,7 @@
--zen-compact-float: calc(var(--zen-element-separation) + 1px);
&:not([animate='true']) {
right: calc(-1 * var(--zen-sidebar-width) + var(--zen-element-separation));
right: calc(-1 * var(--zen-sidebar-width) + 1px);
}
}

View File

@@ -100,8 +100,6 @@ var gZenCompactModeManager = {
},
updateCompactModeContext(isSingleToolbar) {
this.getAndApplySidebarWidth(); // Ignore return value
const IDs = [
'zen-context-menu-compact-mode-hide-sidebar',
'zen-context-menu-compact-mode-hide-toolbar',
@@ -176,21 +174,20 @@ var gZenCompactModeManager = {
{
ease: 'easeIn',
type: 'spring',
stiffness: 3000,
damping: 150,
mass: 1,
bounce: 0,
duration: 0.2,
}
)
.then(() => {
this.sidebar.removeAttribute('animate');
this.sidebar.style.transition = 'none';
this.sidebar.style.removeProperty('margin-right');
this.sidebar.style.removeProperty('margin-left');
this.sidebar.style.removeProperty('transform');
this._animating = false;
this.sidebar.style.transition = 'none';
setTimeout(() => {
this._animating = false;
this.sidebar.style.removeProperty('transition');
});
}, 100);
});
} else if (canHideSidebar && !isCompactMode) {
document.getElementById('browser').style.overflow = 'hidden';
@@ -211,9 +208,8 @@ var gZenCompactModeManager = {
{
ease: 'easeOut',
type: 'spring',
stiffness: 3000,
damping: 150,
mass: 1,
bounce: 0,
duration: 0.2,
}
)
.then(() => {