すべてのタブをウィンドウ外へドラッグした時にそもそもウィンドウを開かないように
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@3414 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
cc35a7bf1f
commit
49a91c0a6a
@ -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);
|
||||
|
@ -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 */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user