From a0ecb160620f6533f96521da3f4ccacabd7f9d3e Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 14 Jan 2010 08:50:10 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=84=E3=83=AA=E3=83=BC=E5=85=A8=E4=BD=93?= =?UTF-8?q?=E3=82=92=E5=BE=A9=E5=85=83=E3=81=99=E3=82=8B=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=81=AFundoCloseTab()=E3=82=92=E4=BD=BF=E3=81=A3=E3=81=9F?= =?UTF-8?q?=E6=99=82=E3=81=A0=E3=81=91=E3=81=AB=E9=99=90=E5=AE=9A=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F?= 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@6087 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 14 ++++++++++++++ content/treestyletab/treestyletabbrowser.js | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index d798611c..8a2d2041 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -144,6 +144,20 @@ var TreeStyleTabService = { ) ); + if ('undoCloseTab' in window) { + eval('window.undoCloseTab = '+ + window.undoCloseTab.toSource().replace( + /(\btab\s*=\s*[^\.]+\.undoCloseTab\([^;]+\);)/, + + ) + ); + } + this.overrideExtensionsPreInit(); // hacks.js this.registerTabFocusAllowance(this.defaultTabFocusAllowance); diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index 3730ac2e..92b9bc10 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -2184,6 +2184,8 @@ TreeStyleTabBrowser.prototype = { { var behavior = this.undoCloseTabSetBehavior(0, true); if ( + aRestoredTab.__treestyletab__restoredByUndoCloseTab || + !this.browser.__treestyletab__readyToUndoCloseTab || this.useTMPSessionAPI || this._restoringClosedSet || !(behavior & this.kUNDO_CLOSE_SET || behavior & this.kUNDO_ASK) @@ -2237,6 +2239,8 @@ TreeStyleTabBrowser.prototype = { onTabRestored : function TSTBrowser_onTabRestored(aEvent) { + delete aEvent.originalTarget.__treestyletab__restoredByUndoCloseTab; + // update the status for the next restoring if (!this.useTMPSessionAPI && TreeStyleTabService.restoringWindow) TreeStyleTabService.restoringWindow = TreeStyleTabService.getRestoringTabsCount() > 0;