不可視のタブがある時にツリーの構造がおかしくなる問題に対処(不可視のタブは自動的に下に寄せるようにした)
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@7282 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
79276e57e9
commit
faf4d3a47d
@ -2550,6 +2550,7 @@ TreeStyleTabBrowser.prototype = {
|
||||
this.internallyTabMovingCount++;
|
||||
var tabs = this.getAllTabsArray(this.mTabBrowser);
|
||||
aChangedTabs = aChangedTabs || tabs;
|
||||
var lastVisibleTab = this.getLastVisibleTab(this.mTabBrowser);
|
||||
tabs.reverse().forEach(function(aTab) {
|
||||
var parent = this.getParentTab(aTab);
|
||||
var attached = false;
|
||||
@ -2573,6 +2574,7 @@ TreeStyleTabBrowser.prototype = {
|
||||
this.partTab(aTab);
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
!aTab.hidden &&
|
||||
!attached &&
|
||||
@ -2580,6 +2582,15 @@ TreeStyleTabBrowser.prototype = {
|
||||
aChangedTabs.indexOf(aTab) > -1
|
||||
)
|
||||
this.attachTabFromPosition(aTab, tabs.length-1);
|
||||
|
||||
// Hidden tabs have to be moved below visible tabs, because
|
||||
// sometimes hidden tabs between visible tabs break tree
|
||||
// structure.
|
||||
if (aTab.hidden) {
|
||||
let newPos = lastVisibleTab._tPos;
|
||||
if (aTab.tPos < lastVisibleTab._tPos) newPos--;
|
||||
this.mTabBrowser.moveTabTo(aTab, newPos);
|
||||
}
|
||||
}, this);
|
||||
this.internallyTabMovingCount--;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user