From 551572acd38c820b6bbe12e6130be2be383f505b Mon Sep 17 00:00:00 2001 From: piro Date: Mon, 21 Dec 2009 05:33:32 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=84=E3=83=AA=E3=83=BC=E5=85=A8=E4=BD=93?= =?UTF-8?q?=E3=82=92=E9=96=89=E3=81=98=E3=82=8B=E6=99=82=E3=82=82=E4=B8=AD?= =?UTF-8?q?=E9=96=93=E3=81=AE=E3=82=A2=E3=83=8B=E3=83=A1=E3=83=BC=E3=82=B7?= =?UTF-8?q?=E3=83=A7=E3=83=B3=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=97=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=82=88=E3=81=86=E3=81=AB=E3=80=82?= 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@5575 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 20 ++++++++++++++++++- content/treestyletab/treestyletabbrowser.js | 9 ++++++++- .../treestyletabbrowser_autoHide.js | 18 ----------------- 3 files changed, 27 insertions(+), 20 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index abcc727c..f83dc7e3 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -495,6 +495,24 @@ var TreeStyleTabService = { /* Utilities */ + stopRendering : function() + { + this.rootContentViewer.hide(); + }, + startRendering : function() + { + this.rootContentViewer.show(); + }, + get rootContentViewer() + { + return window + .QueryInterface(Components.interfaces.nsIInterfaceRequestor) + .getInterface(Components.interfaces.nsIWebNavigation) + .QueryInterface(Components.interfaces.nsIDocShell) + .contentViewer + .QueryInterface(Components.interfaces.nsIMarkupDocumentViewer); + }, + isEventFiredOnTwisty : function(aEvent) { var tab = this.getTabFromEvent(aEvent); @@ -2658,7 +2676,7 @@ catch(e) { this.promoteTab(this.browser.selectedTab); }, - demoteTab : function(aTab) /* PUBLIC API */ + demoteTab : function(aTab) /* PUBLIC API */ { var b = this.getTabBrowserFromChild(aTab); var sv = b.treeStyleTab; diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 0a7c4767..10d2361c 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1498,10 +1498,14 @@ TreeStyleTabBrowser.prototype = { var closeParentBehavior = this.getTreePref('closeParentBehavior'); var closeRootBehavior = this.getTreePref('closeRootBehavior'); + var collapsed = this.isSubtreeCollapsed(tab); if ( closeParentBehavior == this.CLOSE_PARENT_BEHAVIOR_CLOSE || - this.isSubtreeCollapsed(tab) + collapsed ) { + if (collapsed) + this.stopRendering(); + this.getDescendantTabs(tab).reverse().forEach(function(aTab) { b.removeTab(aTab); }, this); @@ -1513,6 +1517,9 @@ TreeStyleTabBrowser.prototype = { ) { b.addTab('about:blank'); } + + if (collapsed) + this.startRendering(); } var firstChild = this.getFirstChildTab(tab); diff --git a/content/treestyletab/treestyletabbrowser_autoHide.js b/content/treestyletab/treestyletabbrowser_autoHide.js index b47003c2..6b8f57b4 100644 --- a/content/treestyletab/treestyletabbrowser_autoHide.js +++ b/content/treestyletab/treestyletabbrowser_autoHide.js @@ -436,24 +436,6 @@ TreeStyleTabBrowserAutoHide.prototype = { }, 0, this); }, - stopRendering : function() - { - this.rootContentViewer.hide(); - }, - startRendering : function() - { - this.rootContentViewer.show(); - }, - get rootContentViewer() - { - return window - .QueryInterface(Components.interfaces.nsIInterfaceRequestor) - .getInterface(Components.interfaces.nsIWebNavigation) - .QueryInterface(Components.interfaces.nsIDocShell) - .contentViewer - .QueryInterface(Components.interfaces.nsIMarkupDocumentViewer); - }, - show : function(aReason) { if (!this.expanded)