From 49a91c0a6a6eaa74e3f48afbf08ddc6613b7f570 Mon Sep 17 00:00:00 2001 From: piro Date: Mon, 1 Dec 2008 09:14:05 +0000 Subject: [PATCH] =?UTF-8?q?=E3=81=99=E3=81=B9=E3=81=A6=E3=81=AE=E3=82=BF?= =?UTF-8?q?=E3=83=96=E3=82=92=E3=82=A6=E3=82=A3=E3=83=B3=E3=83=89=E3=82=A6?= =?UTF-8?q?=E5=A4=96=E3=81=B8=E3=83=89=E3=83=A9=E3=83=83=E3=82=B0=E3=81=97?= =?UTF-8?q?=E3=81=9F=E6=99=82=E3=81=AB=E3=81=9D=E3=82=82=E3=81=9D=E3=82=82?= =?UTF-8?q?=E3=82=A6=E3=82=A3=E3=83=B3=E3=83=89=E3=82=A6=E3=82=92=E9=96=8B?= =?UTF-8?q?=E3=81=8B=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= 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@3414 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletab.js | 9 ++++----- content/treestyletab/treestyletabbrowser.js | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/content/treestyletab/treestyletab.js b/content/treestyletab/treestyletab.js index 2f8d1488..d3497446 100644 --- a/content/treestyletab/treestyletab.js +++ b/content/treestyletab/treestyletab.js @@ -1941,14 +1941,13 @@ catch(e) { if (remoteService.hasChildTabs(remoteTab) || remoteMultipleTabService.isSelected(remoteTab)) { var remoteBrowser = remoteService.getTabBrowserFromChild(remoteTab); - var actionInfo = { - action : this.kACTIONS_FOR_DESTINATION | this.kACTION_IMPORT - }; - var tabsInfo = remoteBrowser.treeStyleTab.getDraggedTabsInfoFromOneTab(actionInfo, remoteTab); - if (tabsInfo.draggedTabs.length == remoteBrowser.mTabContainer.childNodes.length) { + if (remoteBrowser.treeStyleTab.isDraggingAllTabs(remoteTab)) { window.close(); } else { + var actionInfo = { + action : this.kACTIONS_FOR_DESTINATION | this.kACTION_IMPORT + }; window.setTimeout(function() { var blankTab = gBrowser.selectedTab; gBrowser.treeStyleTab.performDrop(actionInfo, remoteTab); diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index c3aa4e2a..ef01bafb 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -404,6 +404,13 @@ TreeStyleTabBrowser.prototype = { ) ); + if ('_onDragEnd' in b) { + eval('b._onDragEnd = '+b._onDragEnd.toSource().replace( + 'this._replaceTabWithWindow(', + 'if (this.treeStyleTab.isDraggingAllTabs(draggedTab)) return; $&' + )); + } + var tabs = b.mTabContainer.childNodes; for (var i = 0, maxi = tabs.length; i < maxi; i++) { @@ -2358,6 +2365,15 @@ TreeStyleTabBrowser.prototype = { xpathResult.snapshotItem(i).removeAttribute(this.kDROP_POSITION); } }, + + isDraggingAllTabs : function(aTab) + { + var actionInfo = { + action : this.kACTIONS_FOR_DESTINATION | this.kACTION_IMPORT + }; + var tabsInfo = this.getDraggedTabsInfoFromOneTab(actionInfo, aTab); + return tabsInfo.draggedTabs.length == this.mTabBrowser.mTabContainer.childNodes.length; + }, /* commands */