From faf4d3a47d63aed7866cc50cc8f4f022bd8be43a Mon Sep 17 00:00:00 2001 From: piro Date: Wed, 13 Oct 2010 15:06:41 +0000 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E8=A6=96=E3=81=AE=E3=82=BF?= =?UTF-8?q?=E3=83=96=E3=81=8C=E3=81=82=E3=82=8B=E6=99=82=E3=81=AB=E3=83=84?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E3=81=AE=E6=A7=8B=E9=80=A0=E3=81=8C=E3=81=8A?= =?UTF-8?q?=E3=81=8B=E3=81=97=E3=81=8F=E3=81=AA=E3=82=8B=E5=95=8F=E9=A1=8C?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=87=A6=EF=BC=88=E4=B8=8D=E5=8F=AF=E8=A6=96?= =?UTF-8?q?=E3=81=AE=E3=82=BF=E3=83=96=E3=81=AF=E8=87=AA=E5=8B=95=E7=9A=84?= =?UTF-8?q?=E3=81=AB=E4=B8=8B=E3=81=AB=E5=AF=84=E3=81=9B=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F=EF=BC=89?= 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@7282 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 2ec30e10..99ae9ae8 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -2550,6 +2550,7 @@ TreeStyleTabBrowser.prototype = { this.internallyTabMovingCount++; var tabs = this.getAllTabsArray(this.mTabBrowser); aChangedTabs = aChangedTabs || tabs; + var lastVisibleTab = this.getLastVisibleTab(this.mTabBrowser); tabs.reverse().forEach(function(aTab) { var parent = this.getParentTab(aTab); var attached = false; @@ -2573,6 +2574,7 @@ TreeStyleTabBrowser.prototype = { this.partTab(aTab); } } + if ( !aTab.hidden && !attached && @@ -2580,6 +2582,15 @@ TreeStyleTabBrowser.prototype = { aChangedTabs.indexOf(aTab) > -1 ) this.attachTabFromPosition(aTab, tabs.length-1); + + // Hidden tabs have to be moved below visible tabs, because + // sometimes hidden tabs between visible tabs break tree + // structure. + if (aTab.hidden) { + let newPos = lastVisibleTab._tPos; + if (aTab.tPos < lastVisibleTab._tPos) newPos--; + this.mTabBrowser.moveTabTo(aTab, newPos); + } }, this); this.internallyTabMovingCount--; },