diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 43f562df..549b35e4 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -2274,10 +2274,10 @@ catch(e) { var parent = this.getParentTab(aTabs[0]); - var prev = aTabs[0]; + var next = aTabs[0]; while ( - (prev = this.getNextSiblingTab(prev)) && - aTabs.indexOf(prev) > -1 + (next = this.getNextSiblingTab(next)) && + aTabs.indexOf(next) > -1 ); window.setTimeout(function(aSelf) { @@ -2287,9 +2287,12 @@ catch(e) { }, aSelf); if (parent) { b.treeStyleTab.attachTabTo(root, parent, { - insertBefore : prev + insertBefore : next }); } + else if (next) { + b.treeStyleTab.moveTabSubTreeTo(root, next._tPos); + } }, 0, this); }, canCreateSubTree : function(aTabs)