グループの自動的な再構成をより賢く
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@7245 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
801e04b795
commit
54f00c8102
@ -2547,47 +2547,41 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
tabVisibilityChangedTabs : [],
|
tabVisibilityChangedTabs : [],
|
||||||
updateTreeByTabVisibility : function TSTBrowser_updateTreeByTabVisibility(aChangedTabs)
|
updateTreeByTabVisibility : function TSTBrowser_updateTreeByTabVisibility(aChangedTabs)
|
||||||
{
|
{
|
||||||
aChangedTabs = aChangedTabs || [];
|
this.internallyTabMovingCount++;
|
||||||
var hiddenTabs = aChangedTabs.filter(function(aTab) { return aTab.hidden; });
|
|
||||||
var shownTabs = aChangedTabs.filter(function(aTab) { return !aTab.hidden; });
|
|
||||||
var tabs = this.getAllTabsArray(this.mTabBrowser);
|
|
||||||
|
|
||||||
aChangedTabs.forEach(function(aTab) {
|
|
||||||
this.collapseExpandTab(aTab, false, true);
|
|
||||||
if (aTab.hidden) {
|
|
||||||
this.partAllChildren(aTab, {
|
|
||||||
behavior : this.getParentTab(aTab) ?
|
|
||||||
this.getTreePref('closeParentBehavior') :
|
|
||||||
this.getTreePref('closeRootBehavior')
|
|
||||||
});
|
|
||||||
this.partTab(aTab);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.attachTabFromPosition(aTab, tabs.length-1);
|
|
||||||
}
|
|
||||||
}, this);
|
|
||||||
|
|
||||||
/*
|
|
||||||
var tabs = this.getAllTabsArray(this.mTabBrowser);
|
var tabs = this.getAllTabsArray(this.mTabBrowser);
|
||||||
|
aChangedTabs = aChangedTabs || tabs;
|
||||||
tabs.reverse().forEach(function(aTab) {
|
tabs.reverse().forEach(function(aTab) {
|
||||||
var parent = this.getParentTab(aTab);
|
var parent = this.getParentTab(aTab);
|
||||||
|
var attached = false;
|
||||||
if (parent && aTab.hidden != parent.hidden) {
|
if (parent && aTab.hidden != parent.hidden) {
|
||||||
this.collapseExpandTab(aTab, false, true);
|
var ancestor = parent;
|
||||||
let target = (
|
var lastNextTab = null;
|
||||||
parent.hidden &&
|
while (ancestor = this.getParentTab(ancestor))
|
||||||
aChangedTabs.indexOf(parent) > -1
|
{
|
||||||
) ? parent : aTab ;
|
if (ancestor.hidden == aTab.hidden) {
|
||||||
this.partAllChildren(target, {
|
this.attachTabTo(aTab, ancestor, {
|
||||||
behavior : parent ?
|
dontMove : true,
|
||||||
this.getTreePref('closeParentBehavior') :
|
insertBefore : lastNextTab
|
||||||
this.getTreePref('closeRootBehavior')
|
|
||||||
});
|
});
|
||||||
this.partTab(target);
|
attached = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (!aTab.hidden && aChangedTabs.indexOf(aTab) > -1)
|
lastNextTab = this.getNextSiblingTab(ancestor);
|
||||||
|
}
|
||||||
|
if (!attached) {
|
||||||
|
this.collapseExpandTab(aTab, false, true);
|
||||||
|
this.partTab(aTab);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
!aTab.hidden &&
|
||||||
|
!attached &&
|
||||||
|
!parent &&
|
||||||
|
aChangedTabs.indexOf(aTab) > -1
|
||||||
|
)
|
||||||
this.attachTabFromPosition(aTab, tabs.length-1);
|
this.attachTabFromPosition(aTab, tabs.length-1);
|
||||||
}, this);
|
}, this);
|
||||||
*/
|
this.internallyTabMovingCount--;
|
||||||
},
|
},
|
||||||
|
|
||||||
onTabRestoring : function TSTBrowser_onTabRestoring(aEvent)
|
onTabRestoring : function TSTBrowser_onTabRestoring(aEvent)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user