mirror of
https://github.com/zen-browser/desktop.git
synced 2026-08-26 16:31:30 +00:00
Enhance compact mode functionality by refining sidebar animation conditions and updating CSS ignore rules
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user