From 14a2370d4f1c9bac057495b1fb45f9eeb5bf1ac1 Mon Sep 17 00:00:00 2001 From: Piro / SHIMODA Hiroshi Date: Sat, 30 Jul 2011 02:10:28 +0900 Subject: [PATCH] When a root tab is closed and there is only one left "dummy" group-tab, then close it automatically. --- modules/browser.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/browser.js b/modules/browser.js index 98bc0eea..eea6e0fa 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -4364,6 +4364,17 @@ TreeStyleTabBrowser.prototype = { var b = this.mTabBrowser; var parentTab = this.getParentTab(aTab); var children = this.getChildTabs(aTab); + + if ( + this.isGroupTab(aTab) && + this.getTabsArray(b).filter(function(aTab) { + return !b._removingTabs || b._removingTabs.indexOf(aTab) < 0; + }).length == children.length + ) { + aInfo.behavior = this.kCLOSE_PARENT_BEHAVIOR_PROMOTE_ALL_CHILDREN; + dontUpdateIndent = aInfo.dontUpdateIndent = false; + } + var insertBefore = null; if (aInfo.behavior == this.kCLOSE_PARENT_BEHAVIOR_DETACH_ALL_CHILDREN && !this.getTreePref('closeParentBehavior.moveDetachedTabsToBottom')) {