グループの最後の子を閉じたら、グループ用のダミーのタブも同時に閉じるようにした

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4543 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-06-19 18:02:48 +00:00
parent 0244ea9975
commit 2288938d0c

View File

@ -1473,16 +1473,25 @@ TreeStyleTabBrowser.prototype = {
} }
} }
let ancestors = []; let ancestors = [],
ancestor = parentTab;
do { do {
ancestors.push(parentTab.getAttribute(this.kID)); ancestors.push(ancestor.getAttribute(this.kID));
if (!next && (next = this.getNextSiblingTab(parentTab))) if (!next && (next = this.getNextSiblingTab(ancestor)))
backupAttributes[this.kINSERT_BEFORE] = next.getAttribute(this.kID); backupAttributes[this.kINSERT_BEFORE] = next.getAttribute(this.kID);
} }
while (parentTab = this.getParentTab(parentTab)); while (ancestor = this.getParentTab(ancestor));
backupAttributes[this.kANCESTOR] = ancestors.join('|'); backupAttributes[this.kANCESTOR] = ancestors.join('|');
this.partTab(tab, true); 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) { else if (!nextFocusedTab) {
nextFocusedTab = this.getNextSiblingTab(tab); nextFocusedTab = this.getNextSiblingTab(tab);