すべてのタブをウィンドウ外へドラッグした時にそもそもウィンドウを開かないように

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@3414 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2008-12-01 09:14:05 +00:00
parent cc35a7bf1f
commit 49a91c0a6a
2 changed files with 20 additions and 5 deletions

View File

@ -1941,14 +1941,13 @@ catch(e) {
if (remoteService.hasChildTabs(remoteTab) || if (remoteService.hasChildTabs(remoteTab) ||
remoteMultipleTabService.isSelected(remoteTab)) { remoteMultipleTabService.isSelected(remoteTab)) {
var remoteBrowser = remoteService.getTabBrowserFromChild(remoteTab); var remoteBrowser = remoteService.getTabBrowserFromChild(remoteTab);
var actionInfo = { if (remoteBrowser.treeStyleTab.isDraggingAllTabs(remoteTab)) {
action : this.kACTIONS_FOR_DESTINATION | this.kACTION_IMPORT
};
var tabsInfo = remoteBrowser.treeStyleTab.getDraggedTabsInfoFromOneTab(actionInfo, remoteTab);
if (tabsInfo.draggedTabs.length == remoteBrowser.mTabContainer.childNodes.length) {
window.close(); window.close();
} }
else { else {
var actionInfo = {
action : this.kACTIONS_FOR_DESTINATION | this.kACTION_IMPORT
};
window.setTimeout(function() { window.setTimeout(function() {
var blankTab = gBrowser.selectedTab; var blankTab = gBrowser.selectedTab;
gBrowser.treeStyleTab.performDrop(actionInfo, remoteTab); gBrowser.treeStyleTab.performDrop(actionInfo, remoteTab);

View File

@ -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; var tabs = b.mTabContainer.childNodes;
for (var i = 0, maxi = tabs.length; i < maxi; i++) for (var i = 0, maxi = tabs.length; i < maxi; i++)
{ {
@ -2359,6 +2366,15 @@ TreeStyleTabBrowser.prototype = {
} }
}, },
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 */ /* commands */
/* attach/part */ /* attach/part */