ルートのタブの並び順が壊れることがあったのを修正

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5169 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-09-30 23:52:31 +00:00
parent 18f973ca30
commit 6411000eec

View File

@ -1853,7 +1853,6 @@ TreeStyleTabBrowser.prototype = {
if (parent) {
this.attachTabTo(tab, parent, {
dontExpand : true,
insertBefore : nextTab,
dontUpdateIndent : true,
dontAnimate : aWithoutAnimation
});
@ -1873,7 +1872,10 @@ TreeStyleTabBrowser.prototype = {
}
if (!parent) {
if (!nextTab) nextTab = this.getNextTab(tab);
if (nextTab == tab)
nextTab = this.getNextSiblingTab(tab);
else if (!nextTab)
nextTab = this.getNextTab(tab);
let parentOfNext = this.getParentTab(nextTab);
let newPos = -1;
if (parentOfNext) {
@ -1884,6 +1886,9 @@ TreeStyleTabBrowser.prototype = {
newPos = nextTab._tPos;
if (newPos > tab._tPos) newPos--;
}
else {
newPos = this.getTabs(b).snapshotLength - 1;
}
if (newPos > -1)
b.moveTabTo(tab, newPos);
}