From d795802474f2b7060a167f4b0e0a9279aecf10e0 Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 7 May 2009 02:19:10 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=9E=E3=83=AB=E3=83=81=E3=83=97=E3=83=AB?= =?UTF-8?q?=E3=82=BF=E3=83=96=E3=83=8F=E3=83=B3=E3=83=89=E3=83=A9=E3=81=AA?= =?UTF-8?q?=E3=81=A9=E3=81=A7=E8=A4=87=E6=95=B0=E3=81=AE=E3=82=BF=E3=83=96?= =?UTF-8?q?=E3=82=92=E4=B8=80=E6=8B=AC=E3=81=A7=E9=96=89=E3=81=98=E3=81=9F?= =?UTF-8?q?=E5=BE=8C=E3=80=81=E3=82=A4=E3=83=B3=E3=83=87=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=81=8C=E5=B4=A9=E3=82=8C=E3=82=8B=E5=95=8F=E9=A1=8C=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= 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@4348 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 7 ++++++- content/treestyletab/treestyletabbrowser.js | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 5ac2d808..78463d67 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -1949,6 +1949,7 @@ catch(e) { { var newTabs = []; aTabs.forEach(function(aTab) { + if (!aTab.parentNode) return; // ignore removed tabs if (newTabs.indexOf(aTab) < 0) newTabs.push(aTab); }); newTabs.sort(function(aA, aB) { @@ -1993,7 +1994,11 @@ catch(e) { } var currentTabInfo; - var tabsInfo = Array.slice(aTabs).map(function(aTab) { + var tabsInfo = Array.slice(aTabs) + .filter(function(aTab) { + return aTab.parentNode; // ignore removed tabs + }) + .map(function(aTab) { var webNav = aTab.linkedBrowser.webNavigation; var url = webNav.currentURI.spec; var name = ''; diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index ac4175c5..55516dc4 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -2587,6 +2587,7 @@ TreeStyleTabBrowser.prototype = { { this.mTabBrowser.movingSelectedTabs = true; // Multiple Tab Handler aTabs.forEach(function(aTab) { + if (!aTab.parentNode) return; // ignore removed tabs if (aParent) this.attachTabTo(aTab, aParent); else @@ -2600,6 +2601,7 @@ TreeStyleTabBrowser.prototype = { { this.mTabBrowser.movingSelectedTabs = true; // Multiple Tab Handler aTabs.forEach(function(aTab) { + if (!aTab.parentNode) return; // ignore removed tabs this.partTab(aTab); this.collapseExpandTab(aTab, false); }, this); @@ -2806,6 +2808,7 @@ TreeStyleTabBrowser.prototype = { var maxIndent = parseInt(aTabs[0].boxObject.height / 2); Array.slice(aTabs).forEach(function(aTab) { + if (!aTab.parentNode) return; // ignore removed tabs if (multirow) { indent = Math.min(aLevel * 3, maxIndent); var colors = '-moz-border-top-colors:'+(function(aNum) { @@ -2842,7 +2845,7 @@ TreeStyleTabBrowser.prototype = { this.updateTabsIndentWithDelayTimer = window.setTimeout(function(aSelf) { var tabs = []; aSelf.updateTabsIndentWithDelayTabs.forEach(function(aTab) { - if (tabs.indexOf(aTab) < 0) tabs.push(aTab); + if (tabs.indexOf(aTab) < 0 && aTab.parentNode) tabs.push(aTab); }); aSelf.updateTabsIndentWithDelayTabs = []; aSelf.updateTabsIndent(tabs);