Enhance compact mode functionality by refining sidebar animation conditions and updating CSS ignore rules

This commit is contained in:
mr. M
2025-01-25 13:42:52 +01:00
parent d996db31d6
commit 63fcbc73a5
3 changed files with 11 additions and 3 deletions

View File

@@ -149,13 +149,17 @@ var gZenCompactModeManager = {
this._animating = true;
const isCompactMode = this.preference;
const canHideSidebar = Services.prefs.getBoolPref('zen.view.compact.hide-tabbar');
const canAnimate =
lazyCompactMode.COMPACT_MODE_CAN_ANIMATE_SIDEBAR &&
!this.sidebar.hasAttribute('zen-user-show') &&
!this.sidebar.hasAttribute('zen-has-hover');
// Do this so we can get the correct width ONCE compact mode styled have been applied
if (lazyCompactMode.COMPACT_MODE_CAN_ANIMATE_SIDEBAR) {
if (canAnimate) {
this.sidebar.setAttribute('animate', 'true');
}
window.requestAnimationFrame(() => {
let sidebarWidth = this.getAndApplySidebarWidth();
if (!lazyCompactMode.COMPACT_MODE_CAN_ANIMATE_SIDEBAR) {
if (!canAnimate) {
this.sidebar.removeAttribute('animate');
this._animating = false;
return;