* 折り畳まれたツリーを閉じたときにウィンドウが閉じられる場合、それが最後のタブであった時にセッション保存の対象になっていなかったのを修正

* https://bugzilla.mozilla.org/show_bug.cgi?id=406216 への対処はもう不要なので、削除

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5563 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-12-19 05:13:04 +00:00
parent f95276a51b
commit 2c589505a9
2 changed files with 20 additions and 12 deletions

View File

@ -2465,18 +2465,22 @@ catch(e) {
}, },
warnAboutClosingTabSubTreeOf : function(aTab) warnAboutClosingTabSubTreeOf : function(aTab)
{ {
if ( if (!this.shouldCloseTabSubTreeOf(aTab))
!aTab ||
(
this.getTreePref('closeParentBehavior') != this.CLOSE_PARENT_BEHAVIOR_CLOSE &&
!this.isSubtreeCollapsed(aTab)
)
)
return true; return true;
var tabs = [aTab].concat(this.getDescendantTabs(aTab)); var tabs = [aTab].concat(this.getDescendantTabs(aTab));
return this.warnAboutClosingTabs(tabs.length); return this.warnAboutClosingTabs(tabs.length);
}, },
shouldCloseTabSubTreeOf : function(aTab)
{
return (
aTab &&
(
this.getTreePref('closeParentBehavior') == this.CLOSE_PARENT_BEHAVIOR_CLOSE ||
this.isSubtreeCollapsed(aTab)
)
);
},
warnAboutClosingTabs : function(aTabsCount) warnAboutClosingTabs : function(aTabsCount)
{ {
if ( if (

View File

@ -483,12 +483,16 @@ TreeStyleTabBrowser.prototype = {
)); ));
} }
// https://bugzilla.mozilla.org/show_bug.cgi?id=406216
if ('_beginRemoveTab' in b) { if ('_beginRemoveTab' in b) {
eval('b._beginRemoveTab = '+b._beginRemoveTab.toSource().replace( eval('b._beginRemoveTab = '+
'for (let i = 0; i < l; ++i) {', b._beginRemoveTab.toSource().replace(
'l = this.mTabs.length; $&' 'if (l == 1) {',
)); 'if (l == 1 || this.treeStyleTab.shouldCloseTabSubTreeOf(aTab)) {'
).replace(
'this._removingTabs.length == 0',
'(this.treeStyleTab.shouldCloseTabSubTreeOf(aTab) || $&)'
)
);
} }
eval('b.removeCurrentTab = '+b.removeCurrentTab.toSource().replace( eval('b.removeCurrentTab = '+b.removeCurrentTab.toSource().replace(