From da3b7211801bca2de90f5952db9e8f2f73c15d26 Mon Sep 17 00:00:00 2001 From: piro Date: Tue, 7 Jul 2009 01:09:50 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=96=E3=83=83=E3=82=AF=E3=83=9E=E3=83=BC?= =?UTF-8?q?=E3=82=AF=E3=83=95=E3=82=A9=E3=83=AB=E3=83=80=E3=81=8B=E3=82=89?= =?UTF-8?q?=E9=96=8B=E3=81=8B=E3=82=8C=E3=81=9F=E3=82=BF=E3=83=96=E3=81=AE?= =?UTF-8?q?=E3=82=B0=E3=83=AB=E3=83=BC=E3=83=97=E3=81=AE=E6=9C=80=E5=BE=8C?= =?UTF-8?q?=E3=81=AE=E5=AD=90=E3=82=92=E9=96=89=E3=81=98=E3=81=9F=E6=99=82?= =?UTF-8?q?=E3=81=AE=E3=83=95=E3=82=A9=E3=83=BC=E3=82=AB=E3=82=B9=E5=88=B6?= =?UTF-8?q?=E5=BE=A1=E3=82=92=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4645 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 31334b7f..fb46ea4e 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1496,11 +1496,16 @@ TreeStyleTabBrowser.prototype = { while (ancestor = this.getParentTab(ancestor)); backupAttributes[this.kANCESTOR] = ancestors.join('|'); + var shouldCloseParentTab = ( + this.isGroupTab(parentTab) && + this.getDescendantTabs(parentTab).length == 1 + ); + if (shouldCloseParentTab && nextFocusedTab == parentTab) + nextFocusedTab = this.getNextFocusedTab(parentTab); + this.partTab(tab, true); - if (this.isGroupTab(parentTab) && !this.getDescendantTabs(parentTab).length) { - if (nextFocusedTab == parentTab) - nextFocusedTab = this.getNextSiblingTab(parentTab) || this.getPreviousSiblingTab(parentTab); + if (shouldCloseParentTab) { // when closing the last tab on Firefox 3.0 if (!this.getPref('browser.tabs.closeWindowWithLastTab') && this.getTabs(b).snapshotLength == 2) @@ -1509,7 +1514,7 @@ TreeStyleTabBrowser.prototype = { } } else if (!nextFocusedTab) { - nextFocusedTab = this.getNextSiblingTab(tab) || this.getPreviousSiblingTab(tab); + nextFocusedTab = this.getNextFocusedTab(tab); } if ( @@ -1537,6 +1542,12 @@ TreeStyleTabBrowser.prototype = { CLOSE_PARENT_BEHAVIOR_CLOSE : 2, CLOSE_ROOT_BEHAVIOR_ESCALATE_FIRST : 3, CLOSE_ROOT_BEHAVIOR_DETACH : 1, + getNextFocusedTab : function(aTab) + { + return this.getNextSiblingTab(aTab) || + this.getPreviousSiblingTab(aTab) || + this.getPreviousVisibleTab(aTab); + }, onTabMove : function(aEvent) {