From 8530305660b85437d501ad4c4a782b4e7d6e4316 Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 25 Mar 2010 15:52:11 +0000 Subject: [PATCH] =?UTF-8?q?=E3=82=B3=E3=83=94=E3=83=9A=E3=83=9F=E3=82=B9?= 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@6457 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 6 +++--- modules/utils.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 7d374188..97ac6c69 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -3463,12 +3463,11 @@ TreeStyleTabBrowser.prototype = { return this.getTabById(aId) && aId != id; }, this).join('|') ); + this.deleteTabValue(aChild, this.kPARENT); if (!this.hasChildTabs(parentTab)) this.setTabValue(parentTab, this.kSUBTREE_COLLAPSED, true); - this.deleteTabValue(aChild, this.kPARENT); - this.updateTabsCount(parentTab); if (!aInfo.dontUpdateIndent) { @@ -4144,7 +4143,8 @@ TreeStyleTabBrowser.prototype = { scrollToTab : function TSTBrowser_scrollToTab(aTab) { - if (!aTab || this.isTabInViewport(aTab)) return; + if (!aTab || !aTab.parentNode || this.isTabInViewport(aTab)) + return; var b = this.mTabBrowser; diff --git a/modules/utils.js b/modules/utils.js index 64608eb5..a9a44013 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -1464,7 +1464,7 @@ var TreeStyleTabUtils = { for (let i = list.length-1; i > -1; i--) { lastChild = this.getTabById(list[i], aTab); - if (lastChild && firstChild != aTab) break; + if (lastChild && lastChild != aTab) break; } } return lastChild;