Skip to content

Commit

Permalink
🐛 Stop vertical tabs from staying collapsed
Browse files Browse the repository at this point in the history
Specificly after a resize
  • Loading branch information
trickypr committed Sep 23, 2023
1 parent d9c148f commit 0e31bb8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/browser/base/content/browser-sidebar-js.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/browser/base/content/browser-sidebar.js b/browser/base/content/browser-sidebar.js
index f5def93f56fc8d02d6ae6834ca8d2df0aead2379..d784fb44e7263d05fbe4bc562afdecf53fe52f8f 100644
index f5def93f56fc8d02d6ae6834ca8d2df0aead2379..976768180f96c3ae1abec661410d42bf8419d2f6 100644
--- a/browser/base/content/browser-sidebar.js
+++ b/browser/base/content/browser-sidebar.js
@@ -11,6 +11,9 @@ var SidebarUI = {
Expand Down Expand Up @@ -178,6 +178,15 @@ index f5def93f56fc8d02d6ae6834ca8d2df0aead2379..d784fb44e7263d05fbe4bc562afdecf5

if (this._box.hasAttribute("positionend")) {
xulStore.persist(this._box, "positionend");
@@ -160,7 +268,7 @@ var SidebarUI = {
/**
* The handler for Services.obs.addObserver.
**/
- observe(_subject, topic, _data) {
+ observe(_subject, topic, data) {
switch (topic) {
case "intl:app-locales-changed": {
if (this.isOpen) {
@@ -171,6 +279,54 @@ var SidebarUI = {
this.showInitially(this.lastOpenedId);
break;
Expand Down
10 changes: 8 additions & 2 deletions src/browser/base/content/browser-verticaltabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,16 @@ var VerticalTabs = {
* @param {MutationObserver} _observer
*/
_mutationObserverCallback(mutationsList, _observer) {
const browserCollapseTabs = Services.prefs.getBoolPref(
VERTICAL_TABS_COLLAPSE,
false,
)
const tabsToolbar = document.getElementById('TabsToolbar')
if (browserCollapseTabs) {
return
}
for (const mutation of mutationsList) {
if (mutation.type === 'attributes' && mutation.attributeName == 'width') {
const tabsToolbar = document.getElementById('TabsToolbar')

Services.prefs.setIntPref(
VERTICAL_TABS_WIDTH,
parseInt(tabsToolbar?.getAttribute('width') || '100'),
Expand Down

0 comments on commit 0e31bb8

Please sign in to comment.