From bb1e18768b45a57f60251e092533ca6707d1f877 Mon Sep 17 00:00:00 2001 From: piro Date: Mon, 22 Oct 2007 20:31:11 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=BF=E3=83=96=E3=82=92=E8=BF=BD=E5=8A=A0?= =?UTF-8?q?=E3=81=97=E3=81=9F=E6=99=82=E3=81=AE=E8=87=AA=E5=8B=95=E9=96=8B?= =?UTF-8?q?=E9=96=89=E3=81=AE=E5=88=A4=E6=96=AD=E5=9F=BA=E6=BA=96=E3=82=92?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= 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@1288 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 1581841f..92e7ef5c 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -1746,13 +1746,15 @@ catch(e) { if (!aInfo.dontExpand) { if ( +/* ( aParent.getAttribute(this.kSUBTREE_COLLAPSED) == 'true' || - children.indexOf('|') < 0 // first child + children.indexOf('|') > -1 // not a first child ) && +*/ this.getPref('extensions.treestyletab.autoCollapseExpandSubTreeOnSelect') ) { - this.collapseExpandTreesIntelligentlyFor(aChild); + this.collapseExpandTreesIntelligentlyFor(aParent); var p = aParent; do { this.collapseExpandTabSubTree(p, false); @@ -2010,7 +2012,7 @@ catch(e) { var b = this.getTabBrowserFromChildren(aTab); if (b.__treestyletab__doingCollapseExpand) return; - var parent = this.getParentTab(aTab); + var sameParentTab = this.getParentTab(aTab); var expandedParentTabs = [ aTab.getAttribute(this.kID) ]; @@ -2035,12 +2037,15 @@ catch(e) { parentTab = this.getParentTab(collapseTab); if (parentTab) { dontCollapse = true; - do { - if (parentTab != parent) continue; - dontCollapse = false; - break; + if (parentTab.getAttribute(this.kSUBTREE_COLLAPSED) != 'true') { + do { + if (expandedParentTabs.indexOf(parentTab.getAttribute(this.kID)) < 0) + continue; + dontCollapse = false; + break; + } + while (parentTab = this.getParentTab(parentTab)); } - while (parentTab = this.getParentTab(parentTab)); } if (!dontCollapse)