From 0f22fc0682ce37e830a45f1584a208ed18e35d0b Mon Sep 17 00:00:00 2001 From: piro Date: Tue, 7 Jul 2009 01:15:13 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=80=E3=83=9F=E3=83=BC=E3=81=AE=E3=82=BF?= =?UTF-8?q?=E3=83=96=E3=82=92=E8=87=AA=E5=8B=95=E7=9A=84=E3=81=AB=E9=96=89?= =?UTF-8?q?=E3=81=98=E3=82=8B=E3=82=BF=E3=82=A4=E3=83=9F=E3=83=B3=E3=82=B0?= =?UTF-8?q?=E3=82=92=E5=A4=89=E6=9B=B4?= 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@4646 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index fb46ea4e..5bcc3c87 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1496,7 +1496,7 @@ TreeStyleTabBrowser.prototype = { while (ancestor = this.getParentTab(ancestor)); backupAttributes[this.kANCESTOR] = ancestors.join('|'); - var shouldCloseParentTab = ( + let shouldCloseParentTab = ( this.isGroupTab(parentTab) && this.getDescendantTabs(parentTab).length == 1 ); @@ -1507,10 +1507,15 @@ TreeStyleTabBrowser.prototype = { if (shouldCloseParentTab) { // when closing the last tab on Firefox 3.0 - if (!this.getPref('browser.tabs.closeWindowWithLastTab') && - this.getTabs(b).snapshotLength == 2) - b.addTab('about:blank'); - b.removeTab(parentTab); + let shouldAddBlankTab = ( + !this.getPref('browser.tabs.closeWindowWithLastTab') && + this.getTabs(b).snapshotLength == 2 + ); + window.setTimeout(function() { + if (!parentTab.parentNode) return; + if (shouldAddBlankTab) b.addTab('about:blank'); + b.removeTab(parentTab); + }, 0); } } else if (!nextFocusedTab) {