From 61f22fa749da75fea1143a5df70b30542473f1f1 Mon Sep 17 00:00:00 2001 From: piro Date: Tue, 27 Nov 2007 00:41:51 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=83=96=E3=82=92=E7=A7=BB=E5=8B=95?= =?UTF-8?q?=E3=81=97=E3=81=9F=E6=99=82=E3=81=AE=E3=83=84=E3=83=AA=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E8=87=AA=E5=8B=95=E7=B7=A8=E9=9B=86=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= 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@1631 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 26 ++++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 85518cc6..84932b4b 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1053,11 +1053,11 @@ TreeStyleTabBrowser.prototype = { var b = this.mTabBrowser; this.initTabContents(tab); // twisty vanished after the tab is moved!! - var rebuildTreeDone = false; +// var rebuildTreeDone = false; if (tab.getAttribute(this.kCHILDREN) && !this.isSubTreeMoving) { this.moveTabSubTreeTo(tab, tab._tPos); - rebuildTreeDone = true; +// rebuildTreeDone = true; } var parentTab = this.getParentTab(tab); @@ -1068,7 +1068,7 @@ TreeStyleTabBrowser.prototype = { this.updateTabsCount(tab, true); if ( - rebuildTreeDone || +// rebuildTreeDone || this.isSubTreeMoving || this.internallyTabMoving ) @@ -1095,14 +1095,22 @@ TreeStyleTabBrowser.prototype = { if (aOldPosition === void(0)) aOldPosition = aTab._tPos; - var pos = this.getChildIndex(aTab, parent); + var pos = this.getChildIndex(aTab, parent); + if (aTab._tPos < aOldPosition) aOldPosition--; var oldPos = this.getChildIndex(this.mTabBrowser.mTabContainer.childNodes[aOldPosition], parent); - if (pos < 0 || oldPos < 0) { - pos = this.getVisibleIndex(aTab); - oldPos = this.getVisibleIndex(this.mTabBrowser.mTabContainer.childNodes[aOldPosition]); + var delta; + if ( +// (parent && ( +// parent != prevParent || +// parent != nextParent +// )) || + pos < 0 || oldPos < 0 + ) { + delta = 2; + } + else { + delta = Math.abs(pos - oldPos); } - var delta = Math.abs(pos - oldPos); - if (pos < oldPos) delta--; var newParent = null;