From 0494e7a2293fa7f33d61e1663c26bc43575e1d16 Mon Sep 17 00:00:00 2001 From: Piro / SHIMODA Hiroshi Date: Sat, 30 Jul 2011 02:52:28 +0900 Subject: [PATCH] Needless dummy "group" tab isn't closed if it is a to-be-restored tab --- modules/browser.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/modules/browser.js b/modules/browser.js index 04f0a8b9..8171068f 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -2773,22 +2773,24 @@ TreeStyleTabBrowser.prototype = { var parent = this.getParentTab(aTab); - this.window.setTimeout(function(aSelf) { - var siblings = parent && parent.parentNode ? aSelf.getChildTabs(parent) : aSelf.visibleRootTabs ; - siblings = siblings.filter(function(aSiblingTab) { - return aSiblingTab != aTab; - }); - var groupTabs = siblings.filter(function(aSiblingTab) { - return aSelf.isGroupTab(aSiblingTab); - }); + var siblings = parent && parent.parentNode ? this.getChildTabs(parent) : this.visibleRootTabs ; + siblings = siblings.filter(function(aSiblingTab) { + return aSiblingTab != aTab; + }); + var groupTabs = siblings.filter(function(aSiblingTab) { + return this.isGroupTab(aSiblingTab); + }, this); - if ( + var groupTab = ( groupTabs.length == 1 && siblings.length == 1 && - aSelf.hasChildTabs(groupTabs[0]) - ) - aSelf.getTabBrowserFromChild(groupTabs[0]).removeTab(groupTabs[0], { animate : true }); - }, 0, this); + this.hasChildTabs(groupTabs[0]) + ) ? groupTabs[0] : null ; + + if (groupTab) + this.window.setTimeout(function(aSelf, aGroupTab) { + aSelf.getTabBrowserFromChild(aGroupTab).removeTab(aGroupTab, { animate : true }); + }, 0, this, groupTab); }, getNextFocusedTab : function TSTBrowser_getNextFocusedTab(aTab) {