diff --git a/content/treestyletab/hacks.js b/content/treestyletab/hacks.js index 70c2dc50..e412d8f4 100644 --- a/content/treestyletab/hacks.js +++ b/content/treestyletab/hacks.js @@ -473,16 +473,6 @@ TreeStyleTabService.overrideExtensionsOnInitAfter = function() { ) ); - eval('gBrowser.TMmoveTabTo = '+ - gBrowser.TMmoveTabTo.toSource().replace( - /(aTab.dispatchEvent)/, - 'this.treeStyleTab.internallyTabMoving = true; $1' - ).replace( - /(return aTab;\})(\)?)$/, - 'this.treeStyleTab.internallyTabMoving = false; $1$2' - ) - ); - window.BrowserHome = window.TM_BrowserHome; window.BrowserOpenTab = window.TMP_BrowserOpenTab; diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index ad45e67a..ec193c95 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1687,30 +1687,15 @@ TreeStyleTabBrowser.prototype = { ) return; - this.attachTabFromPosition(tab, aEvent.detail); + this.attachTabFromPosition(tab); this.showTabbarForFeedback(); }, - attachTabFromPosition : function(aTab, aOldPosition) + attachTabFromPosition : function(aTab) { var parent = this.getParentTab(aTab); - if (aOldPosition === void(0)) aOldPosition = aTab._tPos; - - var pos = this.getChildIndex(aTab, parent); - var oldPos = this.getChildIndex(this.getTabs(this.mTabBrowser).snapshotItem(aOldPosition), parent); - var delta; - if (pos == oldPos) { // no move? - return; - } - else if (pos < 0 || oldPos < 0) { - delta = 2; - } - else { - delta = Math.abs(pos - oldPos); - } - var prevTab = this.getPreviousTab(aTab); var nextTab = this.getNextTab(aTab); @@ -1731,17 +1716,16 @@ TreeStyleTabBrowser.prototype = { newParent = null; } else if (!nextTab) { - newParent = (delta > 1) ? prevParent : parent ; + newParent = prevParent || parent ; } else if (prevParent == nextParent) { newParent = prevParent; } else if (prevLevel > nextLevel) { - var realDelta = Math.abs(aTab._tPos - aOldPosition); - newParent = realDelta < 2 ? prevParent : parent ; + newParent = prevParent || parent || nextParent; } else if (prevLevel < nextLevel) { - newParent = this.getParentTab(aTab) || this.getParentTab(nextTab); + newParent = parent || nextParent; } if (newParent != parent) {