From 2288938d0c6ef1e0c4fd6e392d1700f6c3cb3c66 Mon Sep 17 00:00:00 2001 From: piro Date: Fri, 19 Jun 2009 18:02:48 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=B0=E3=83=AB=E3=83=BC=E3=83=97=E3=81=AE?= =?UTF-8?q?=E6=9C=80=E5=BE=8C=E3=81=AE=E5=AD=90=E3=82=92=E9=96=89=E3=81=98?= =?UTF-8?q?=E3=81=9F=E3=82=89=E3=80=81=E3=82=B0=E3=83=AB=E3=83=BC=E3=83=97?= =?UTF-8?q?=E7=94=A8=E3=81=AE=E3=83=80=E3=83=9F=E3=83=BC=E3=81=AE=E3=82=BF?= =?UTF-8?q?=E3=83=96=E3=82=82=E5=90=8C=E6=99=82=E3=81=AB=E9=96=89=E3=81=98?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= 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@4543 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index fceb59a9..78ecd9a0 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1473,16 +1473,25 @@ TreeStyleTabBrowser.prototype = { } } - let ancestors = []; + let ancestors = [], + ancestor = parentTab; do { - ancestors.push(parentTab.getAttribute(this.kID)); - if (!next && (next = this.getNextSiblingTab(parentTab))) + ancestors.push(ancestor.getAttribute(this.kID)); + if (!next && (next = this.getNextSiblingTab(ancestor))) backupAttributes[this.kINSERT_BEFORE] = next.getAttribute(this.kID); } - while (parentTab = this.getParentTab(parentTab)); + while (ancestor = this.getParentTab(ancestor)); backupAttributes[this.kANCESTOR] = ancestors.join('|'); this.partTab(tab, true); + + if (parentTab.linkedBrowser.sessionHistory.count == 1 && + parentTab.linkedBrowser.currentURI.spec.indexOf('about:treestyletab-group') > -1 && + !this.getDescendantTabs(parentTab).length) { + if (nextFocusedTab == parentTab) + nextFocusedTab = null; + b.removeTab(parentTab); + } } else if (!nextFocusedTab) { nextFocusedTab = this.getNextSiblingTab(tab);