From 9294210897a3d26d8950628e1b44b234780cd1ae Mon Sep 17 00:00:00 2001 From: piro Date: Tue, 1 Sep 2009 10:30:21 +0000 Subject: [PATCH] =?UTF-8?q?*=20API=E3=81=AB=E3=82=88=E3=82=8B=E3=82=BF?= =?UTF-8?q?=E3=83=96=E3=81=AE=E7=A7=BB=E5=8B=95=E3=81=A7=E3=81=AE=E3=83=84?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E5=86=8D=E6=A7=8B=E7=AF=89=E3=81=AB=E3=81=A4?= =?UTF-8?q?=E3=81=84=E3=81=A6=E3=80=81=E5=87=A6=E7=90=86=E3=82=92=E7=B0=A1?= =?UTF-8?q?=E7=95=A5=E5=8C=96=20*=20TMP=E3=81=A7=E3=82=BF=E3=83=96?= =?UTF-8?q?=E3=81=AE=E6=8C=BF=E5=85=A5=E4=BD=8D=E7=BD=AE=E3=82=92=E5=88=B6?= =?UTF-8?q?=E5=BE=A1=E3=81=99=E3=82=8B=E8=A8=AD=E5=AE=9A=E3=81=AE=E3=81=A8?= =?UTF-8?q?=E3=81=8D=E3=81=AB=E3=83=96=E3=83=83=E3=82=AF=E3=83=9E=E3=83=BC?= =?UTF-8?q?=E3=82=AF=E7=AD=89=E3=81=8B=E3=82=89=E6=96=B0=E3=81=97=E3=81=84?= =?UTF-8?q?=E3=82=BF=E3=83=96=E3=82=92=E9=96=8B=E3=81=8F=E3=81=A8=E3=83=84?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=81=8C=E3=81=8A=E3=81=8B=E3=81=97=E3=81=8F?= =?UTF-8?q?=E3=81=AA=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E3=81=97=E3=81=9F=E3=81=A4=E3=82=82=E3=82=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5030 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/hacks.js | 10 -------- content/treestyletab/treestyletabbrowser.js | 26 ++++----------------- 2 files changed, 5 insertions(+), 31 deletions(-) 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) {