自動でサブツリーを開閉するとき、他のサブツリーについてはルートだけをたたむようにした
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@1230 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
3e94c50af9
commit
f6c034ec86
@ -998,6 +998,7 @@ var TreeStyleTabService = {
|
||||
collapseExpandTreesIntelligentlyFor : function(aTab)
|
||||
{
|
||||
var b = this.getTabBrowserFromChildren(aTab);
|
||||
var parent = this.getParentTabOf(aTab);
|
||||
var expandedParentTabs = [
|
||||
aTab.getAttribute(this.kID)
|
||||
];
|
||||
@ -1016,18 +1017,24 @@ var TreeStyleTabService = {
|
||||
null
|
||||
);
|
||||
var collapseTab;
|
||||
var isDescendant;
|
||||
var dontCollapse;
|
||||
for (var i = 0, maxi = xpathResult.snapshotLength; i < maxi; i++)
|
||||
{
|
||||
isDescendant = false;
|
||||
dontCollapse = false;
|
||||
collapseTab = xpathResult.snapshotItem(i);
|
||||
var parentTab = collapseTab;
|
||||
while (parentTab = this.getParentTabOf(parentTab))
|
||||
{
|
||||
if (parentTab != aTab) continue;
|
||||
isDescendant = true;
|
||||
|
||||
parentTab = this.getParentTabOf(collapseTab);
|
||||
if (parentTab) {
|
||||
dontCollapse = true;
|
||||
do {
|
||||
if (parentTab != parent) continue;
|
||||
dontCollapse = false;
|
||||
break;
|
||||
}
|
||||
if (!isDescendant)
|
||||
while (parentTab = this.getParentTabOf(parentTab));
|
||||
}
|
||||
|
||||
if (!dontCollapse)
|
||||
this.collapseExpandTabSubTree(collapseTab, true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user