From c8cf5b26c27ebbf13e9fe81306e1eb8d61094ebe Mon Sep 17 00:00:00 2001 From: piro Date: Mon, 21 Dec 2009 05:45:07 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BB=96=E3=81=AE=E5=A0=B4=E9=9D=A2=E3=81=A7?= =?UTF-8?q?=E3=82=82=E6=8F=8F=E7=94=BB=E3=81=AE=E4=B8=80=E6=99=82=E5=81=9C?= =?UTF-8?q?=E6=AD=A2=E3=82=92=E8=A1=8C=E3=81=86=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=BF=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@5576 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 9 +++++++-- content/treestyletab/treestyletabbrowser.js | 22 +++++++++++++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index f83dc7e3..9b7874e3 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -497,12 +497,17 @@ var TreeStyleTabService = { stopRendering : function() { - this.rootContentViewer.hide(); + if (!this._stopRenderingLevel) + this.rootContentViewer.hide(); + this._stopRenderingLevel++; }, startRendering : function() { - this.rootContentViewer.show(); + this._stopRenderingLevel--; + if (!this._stopRenderingLevel) + this.rootContentViewer.show(); }, + _stopRenderingLevel : 0, get rootContentViewer() { return window diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 10d2361c..95d7f05c 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -750,6 +750,8 @@ TreeStyleTabBrowser.prototype = { initTabbar : function(aPosition) { + this.stopRendering(); + var b = this.mTabBrowser; if (!aPosition) aPosition = this.currentTabbarPosition; @@ -954,10 +956,14 @@ TreeStyleTabBrowser.prototype = { scrollInnerBox = null; scrollInnerBox = null; allTabsButton = null; + + this.startRendering(); }, updateTabbarState : function() { + this.stopRendering(); + var b = this.mTabBrowser; var orient; if (this.isVertical) { @@ -997,6 +1003,7 @@ TreeStyleTabBrowser.prototype = { else b.removeAttribute(this.kHIDE_ALLTABS); + this.startRendering(); this.updateAllTabsIndent(); }, @@ -1498,12 +1505,16 @@ TreeStyleTabBrowser.prototype = { var closeParentBehavior = this.getTreePref('closeParentBehavior'); var closeRootBehavior = this.getTreePref('closeRootBehavior'); - var collapsed = this.isSubtreeCollapsed(tab); + var collapsed = this.isCollapsed(tab); + if (collapsed) + this.stopRendering(); + + var subtreeCollapsed = this.isSubtreeCollapsed(tab); if ( closeParentBehavior == this.CLOSE_PARENT_BEHAVIOR_CLOSE || - collapsed + subtreeCollapsed ) { - if (collapsed) + if (subtreeCollapsed) this.stopRendering(); this.getDescendantTabs(tab).reverse().forEach(function(aTab) { @@ -1518,7 +1529,7 @@ TreeStyleTabBrowser.prototype = { b.addTab('about:blank'); } - if (collapsed) + if (subtreeCollapsed) this.startRendering(); } @@ -1672,6 +1683,9 @@ TreeStyleTabBrowser.prototype = { ) b.selectedTab = nextFocusedTab; } + + if (collapsed) + this.startRendering(); }, CLOSE_PARENT_BEHAVIOR_PROMOTE_FIRST : 3, CLOSE_PARENT_BEHAVIOR_PROMOTE_ALL : 0,