From 45b1e6473c5c2c63c6118eef3e87c5b9a93fd660 Mon Sep 17 00:00:00 2001 From: piro Date: Sat, 26 Dec 2009 04:57:57 +0000 Subject: [PATCH] =?UTF-8?q?=E8=A4=87=E6=95=B0=E3=81=AE=E3=82=BF=E3=83=96?= =?UTF-8?q?=E3=81=8C=E9=96=89=E3=81=98=E3=82=89=E3=82=8C=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=A8=E3=81=97=E3=81=A6=E3=81=84=E3=82=8B=E6=99=82=E3=80=81?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E3=81=AB=E3=82=88=E3=81=A3=E3=81=A6=E3=81=AF?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E3=82=92=E3=82=AD=E3=83=A3=E3=83=B3=E3=82=BB?= =?UTF-8?q?=E3=83=AB=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=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@5650 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 22 ++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index ae1da0c1..e0cea1e8 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -1413,7 +1413,8 @@ TreeStyleTabBrowser.prototype = { case 'MultipleTabHandlerTabsClosing': - this.onTabsRemoved(aEvent.tabs); + if (!this.onTabsRemoving(aEvent)) + aEvent.preventDefault(); return; } }, @@ -1747,11 +1748,26 @@ TreeStyleTabBrowser.prototype = { this.getPreviousVisibleTab(aTab); }, - onTabsRemoved : function TSTBrowser_onTabsRemoved(aTabs) + onTabsRemoving : function TSTBrowser_onTabsRemoving(aEvent) { - this.splitTabsToSubtrees(aTabs).forEach(function(aTabs) { + var b = this.getTabBrowserFromChild(aEvent.tabs[0]); + + var trees = this.splitTabsToSubtrees(aEvent.tabs); + if (trees.some(function(aTabs) { + return aTabs.length > 1 && + !this.fireTabSubtreeClosingEvent(aTabs[0], aTabs); + }, this)) + return false; + + trees.forEach(function(aTabs) { this.markAsClosedSet(aTabs); }, this); + + window.setTimeout(function(aSelf) { + trees.forEach(function(aTabs) { + aSelf.fireTabSubtreeClosedEvent(b, aTabs[0], aTabs); + }); + }, 0, this); }, onTabMove : function TSTBrowser_onTabMove(aEvent)