From 11f04a35053603e6610ce5fbf1249ce018ada207 Mon Sep 17 00:00:00 2001 From: piro Date: Fri, 25 Dec 2009 09:15:25 +0000 Subject: [PATCH] =?UTF-8?q?TabOpen=E3=82=A4=E3=83=99=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=81=8C=E7=99=BA=E8=A1=8C=E3=81=95=E3=82=8C=E3=82=8B=E5=89=8D?= =?UTF-8?q?=E3=81=AB=E3=82=BF=E3=83=96=E3=81=8C=E7=A7=BB=E5=8B=95=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=9F=E5=A0=B4=E5=90=88=E3=81=A7=E3=82=82=E3=83=84?= =?UTF-8?q?=E3=83=AA=E3=83=BC=E6=A7=8B=E9=80=A0=E3=81=8C=E5=A3=8A=E3=82=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= 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@5614 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index b920118d..8ab9c6dc 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -605,9 +605,13 @@ TreeStyleTabBrowser.prototype = { aTab.setAttribute(this.kNEST, 0); }, + isTabInitialized : function TSTBrowser_isTabInitialized(aTab) + { + return aTab.getAttribute(this.kID); + }, ensureTabInitialized : function TSTBrowser_ensureTabInitialized(aTab) { - if (!aTab || aTab.getAttribute(this.kID)) return; + if (!aTab || this.isTabInitialized(aTab)) return; this.initTab(aTab); }, @@ -1416,9 +1420,9 @@ TreeStyleTabBrowser.prototype = { this.lastScrollY = y.value; }, - onTabAdded : function TSTBrowser_onTabAdded(aEvent) + onTabAdded : function TSTBrowser_onTabAdded(aEvent, aTab) { - var tab = aEvent.originalTarget; + var tab = aTab || aEvent.originalTarget; var b = this.mTabBrowser; this.initTab(tab); @@ -1719,7 +1723,13 @@ TreeStyleTabBrowser.prototype = { { var tab = aEvent.originalTarget; var b = this.mTabBrowser; - this.initTabContents(tab); // twisty vanished after the tab is moved!! + + // When the tab was moved before TabOpen event is fired, we have to update manually. + if (!this.isTabInitialized(tab)) + this.onTabAdded(null, tab); + + // twisty vanished after the tab is moved!! + this.initTabContents(tab); if (this.hasChildTabs(tab) && !this.subTreeMovingCount) { this.moveTabSubTreeTo(tab, tab._tPos);