マルチプルタブハンドラなどで複数のタブを一括で閉じた後、インデントが崩れる問題を修正

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4348 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-05-07 02:19:10 +00:00
parent 3fbc76f2ba
commit d795802474
2 changed files with 10 additions and 2 deletions

View File

@ -1949,6 +1949,7 @@ catch(e) {
{ {
var newTabs = []; var newTabs = [];
aTabs.forEach(function(aTab) { aTabs.forEach(function(aTab) {
if (!aTab.parentNode) return; // ignore removed tabs
if (newTabs.indexOf(aTab) < 0) newTabs.push(aTab); if (newTabs.indexOf(aTab) < 0) newTabs.push(aTab);
}); });
newTabs.sort(function(aA, aB) { newTabs.sort(function(aA, aB) {
@ -1993,7 +1994,11 @@ catch(e) {
} }
var currentTabInfo; 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 webNav = aTab.linkedBrowser.webNavigation;
var url = webNav.currentURI.spec; var url = webNav.currentURI.spec;
var name = ''; var name = '';

View File

@ -2587,6 +2587,7 @@ TreeStyleTabBrowser.prototype = {
{ {
this.mTabBrowser.movingSelectedTabs = true; // Multiple Tab Handler this.mTabBrowser.movingSelectedTabs = true; // Multiple Tab Handler
aTabs.forEach(function(aTab) { aTabs.forEach(function(aTab) {
if (!aTab.parentNode) return; // ignore removed tabs
if (aParent) if (aParent)
this.attachTabTo(aTab, aParent); this.attachTabTo(aTab, aParent);
else else
@ -2600,6 +2601,7 @@ TreeStyleTabBrowser.prototype = {
{ {
this.mTabBrowser.movingSelectedTabs = true; // Multiple Tab Handler this.mTabBrowser.movingSelectedTabs = true; // Multiple Tab Handler
aTabs.forEach(function(aTab) { aTabs.forEach(function(aTab) {
if (!aTab.parentNode) return; // ignore removed tabs
this.partTab(aTab); this.partTab(aTab);
this.collapseExpandTab(aTab, false); this.collapseExpandTab(aTab, false);
}, this); }, this);
@ -2806,6 +2808,7 @@ TreeStyleTabBrowser.prototype = {
var maxIndent = parseInt(aTabs[0].boxObject.height / 2); var maxIndent = parseInt(aTabs[0].boxObject.height / 2);
Array.slice(aTabs).forEach(function(aTab) { Array.slice(aTabs).forEach(function(aTab) {
if (!aTab.parentNode) return; // ignore removed tabs
if (multirow) { if (multirow) {
indent = Math.min(aLevel * 3, maxIndent); indent = Math.min(aLevel * 3, maxIndent);
var colors = '-moz-border-top-colors:'+(function(aNum) { var colors = '-moz-border-top-colors:'+(function(aNum) {
@ -2842,7 +2845,7 @@ TreeStyleTabBrowser.prototype = {
this.updateTabsIndentWithDelayTimer = window.setTimeout(function(aSelf) { this.updateTabsIndentWithDelayTimer = window.setTimeout(function(aSelf) {
var tabs = []; var tabs = [];
aSelf.updateTabsIndentWithDelayTabs.forEach(function(aTab) { 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.updateTabsIndentWithDelayTabs = [];
aSelf.updateTabsIndent(tabs); aSelf.updateTabsIndent(tabs);