mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-07 10:26:36 +00:00
Fixed compact mode sidebar animating on an empty state and not animating properly
This commit is contained in:
@@ -113,6 +113,7 @@
|
||||
|
||||
& #urlbar[open][zen-floating-urlbar='true'] {
|
||||
transition: left 0.05s ease;
|
||||
visibility: visible;
|
||||
|
||||
#navigator-toolbox:has(&) {
|
||||
opacity: 1;
|
||||
@@ -134,17 +135,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
#navigator-toolbox[zen-has-hover],
|
||||
#navigator-toolbox[zen-has-hover]:not(:has(#urlbar[zen-floating-urlbar='true']:hover)),
|
||||
#navigator-toolbox[zen-user-show],
|
||||
#navigator-toolbox[zen-has-empty-tab],
|
||||
#navigator-toolbox[flash-popup],
|
||||
#navigator-toolbox[has-popup-menu],
|
||||
#navigator-toolbox[movingtab],
|
||||
#navigator-toolbox:has(.tabbrowser-tab:active),
|
||||
&[zen-renaming-tab='true'] #navigator-toolbox,
|
||||
#navigator-toolbox:has(
|
||||
*:is([panelopen='true'], [open='true'], #urlbar:not([zen-floating-urlbar='true']):focus-within):not(tab):not(.zen-compact-mode-ignore)
|
||||
*:is([panelopen='true'], [open='true'], #urlbar:focus-within):not(#urlbar[zen-floating-urlbar='true']):not(tab):not(.zen-compact-mode-ignore)
|
||||
) {
|
||||
&:not([animate='true']):not(:has(#urlbar[zen-floating-urlbar='true']:hover)) {
|
||||
&:not([animate='true']) {
|
||||
--zen-compact-mode-func: linear(
|
||||
0 0%,
|
||||
0.002748 1%,
|
||||
|
@@ -158,6 +158,7 @@ var gZenCompactModeManager = {
|
||||
const canAnimate =
|
||||
lazyCompactMode.COMPACT_MODE_CAN_ANIMATE_SIDEBAR &&
|
||||
!this.sidebar.hasAttribute('zen-user-show') &&
|
||||
!this.sidebar.hasAttribute('zen-has-empty-tab') &&
|
||||
!this.sidebar.hasAttribute('zen-has-hover');
|
||||
// Do this so we can get the correct width ONCE compact mode styled have been applied
|
||||
if (canAnimate) {
|
||||
@@ -191,15 +192,17 @@ var gZenCompactModeManager = {
|
||||
)
|
||||
.then(() => {
|
||||
window.requestAnimationFrame(() => {
|
||||
this.sidebar.style.transition = 'none';
|
||||
this.sidebar.removeAttribute('animate');
|
||||
this.sidebar.style.visibility = 'hidden';
|
||||
this.sidebar.style.removeProperty('margin-right');
|
||||
this.sidebar.style.removeProperty('margin-left');
|
||||
this.sidebar.style.removeProperty('transform');
|
||||
this.sidebar.style.transition = 'none';
|
||||
setTimeout(() => {
|
||||
this._animating = false;
|
||||
this.sidebar.style.removeProperty('visibility');
|
||||
this.sidebar.style.removeProperty('transition');
|
||||
});
|
||||
}, 300);
|
||||
});
|
||||
});
|
||||
} else if (canHideSidebar && !isCompactMode) {
|
||||
|
@@ -1967,6 +1967,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
}
|
||||
|
||||
async onLocationChange(browser) {
|
||||
gZenCompactModeManager.sidebar.toggleAttribute('zen-has-empty-tab', gBrowser.selectedTab.hasAttribute('zen-empty-tab'));
|
||||
if (!this.workspaceEnabled || this._inChangingWorkspace || this._isClosingWindow) {
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user