diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 6d90544b..40a8e5f7 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1853,6 +1853,7 @@ TreeStyleTabBrowser.prototype = { if (parent) { this.attachTabTo(tab, parent, { dontExpand : true, + insertBefore : nextTab, dontUpdateIndent : true, dontAnimate : aWithoutAnimation }); @@ -1872,10 +1873,7 @@ TreeStyleTabBrowser.prototype = { } if (!parent) { - if (nextTab == tab) - nextTab = this.getNextSiblingTab(tab); - else if (!nextTab) - nextTab = this.getNextTab(tab); + if (!nextTab) nextTab = this.getNextTab(tab); let parentOfNext = this.getParentTab(nextTab); let newPos = -1; if (parentOfNext) { @@ -1886,9 +1884,6 @@ TreeStyleTabBrowser.prototype = { newPos = nextTab._tPos; if (newPos > tab._tPos) newPos--; } - else { - newPos = this.getTabs(b).snapshotLength - 1; - } if (newPos > -1) b.moveTabTo(tab, newPos); }