ツリー全体を復元する機能はundoCloseTab()を使った時だけに限定するようにした

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6087 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-01-14 08:50:10 +00:00
parent 7b0e3fbca7
commit a0ecb16062
2 changed files with 18 additions and 0 deletions

View File

@ -144,6 +144,20 @@ var TreeStyleTabService = {
) )
); );
if ('undoCloseTab' in window) {
eval('window.undoCloseTab = '+
window.undoCloseTab.toSource().replace(
/(\btab\s*=\s*[^\.]+\.undoCloseTab\([^;]+\);)/,
<![CDATA[
gBrowser.__treestyletab__readyToUndoCloseTab = true;
$1
tab.__treestyletab__restoredByUndoCloseTab = true;
delete gBrowser.__treestyletab__readyToUndoCloseTab;
]]>
)
);
}
this.overrideExtensionsPreInit(); // hacks.js this.overrideExtensionsPreInit(); // hacks.js
this.registerTabFocusAllowance(this.defaultTabFocusAllowance); this.registerTabFocusAllowance(this.defaultTabFocusAllowance);

View File

@ -2184,6 +2184,8 @@ TreeStyleTabBrowser.prototype = {
{ {
var behavior = this.undoCloseTabSetBehavior(0, true); var behavior = this.undoCloseTabSetBehavior(0, true);
if ( if (
aRestoredTab.__treestyletab__restoredByUndoCloseTab ||
!this.browser.__treestyletab__readyToUndoCloseTab ||
this.useTMPSessionAPI || this.useTMPSessionAPI ||
this._restoringClosedSet || this._restoringClosedSet ||
!(behavior & this.kUNDO_CLOSE_SET || behavior & this.kUNDO_ASK) !(behavior & this.kUNDO_CLOSE_SET || behavior & this.kUNDO_ASK)
@ -2237,6 +2239,8 @@ TreeStyleTabBrowser.prototype = {
onTabRestored : function TSTBrowser_onTabRestored(aEvent) onTabRestored : function TSTBrowser_onTabRestored(aEvent)
{ {
delete aEvent.originalTarget.__treestyletab__restoredByUndoCloseTab;
// update the status for the next restoring // update the status for the next restoring
if (!this.useTMPSessionAPI && TreeStyleTabService.restoringWindow) if (!this.useTMPSessionAPI && TreeStyleTabService.restoringWindow)
TreeStyleTabService.restoringWindow = TreeStyleTabService.getRestoringTabsCount() > 0; TreeStyleTabService.restoringWindow = TreeStyleTabService.getRestoringTabsCount() > 0;