Skip to content

Commit

Permalink
refactor for CodeRabbit ISSUE: #2156
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard-Woessner committed Oct 21, 2024
1 parent 135a887 commit c36b15d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/browser/base/content/ZenUIManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ var gZenVerticalTabsManager = {
},

_updateOnHoverVerticalTabs() {
let onHover = Services.prefs.getBoolPref('zen.view.sidebar-expanded.on-hover');
let expanded = this.expanded;
let sidebar = this.navigatorToolbox;
const onHover = Services.prefs.getBoolPref('zen.view.sidebar-expanded.on-hover');
const expanded = this.expanded;
const sidebar = this.navigatorToolbox;

if (expanded) {
sidebar.setAttribute('zen-expanded', 'true');
Expand Down Expand Up @@ -179,10 +179,10 @@ var gZenVerticalTabsManager = {
},

_updateMaxWidth() {
let isCompactMode = Services.prefs.getBoolPref('zen.view.compact');
let expanded = this.expanded;
let maxWidth = Services.prefs.getIntPref('zen.view.sidebar-expanded.max-width');
let toolbox = document.getElementById('navigator-toolbox');
const isCompactMode = Services.prefs.getBoolPref('zen.view.compact');
const expanded = this.expanded;
const maxWidth = Services.prefs.getIntPref('zen.view.sidebar-expanded.max-width');
const toolbox = document.getElementById('navigator-toolbox');
if (expanded && !isCompactMode) {
toolbox.style.maxWidth = `${maxWidth}px`;
} else {
Expand All @@ -205,7 +205,7 @@ var gZenVerticalTabsManager = {
toggleExpand() {
const pausedForExpand = Services.prefs.getBoolPref('zen.view.sidebar-expanded.on-hover.paused-for-expand');
const onHover = Services.prefs.getBoolPref('zen.view.sidebar-expanded.on-hover');
let expanded = Services.prefs.getBoolPref('zen.view.sidebar-expanded');
const expanded = Services.prefs.getBoolPref('zen.view.sidebar-expanded');

if (onHover && !expanded) {
// Expand sidebar and disable hover detection
Expand All @@ -217,7 +217,7 @@ var gZenVerticalTabsManager = {
Services.prefs.setBoolPref('zen.view.sidebar-expanded', false);
Services.prefs.setBoolPref('zen.view.sidebar-expanded.on-hover', true); // Re-enable hover detection when closing
}
else if(expanded || !expanded) {
else {
// Toggle sidebar
Services.prefs.setBoolPref('zen.view.sidebar-expanded', !expanded);
}
Expand Down

0 comments on commit c36b15d

Please sign in to comment.