careless miss

This commit is contained in:
Piro / SHIMODA Hiroshi 2010-12-02 08:40:26 +09:00
parent d35d743e8e
commit f661405af0
2 changed files with 15 additions and 11 deletions

View File

@ -148,7 +148,9 @@
'ancestor-or-self::*[local-name()="tabbrowser"] | '+
'ancestor-or-self::*[local-name()="tabs" and @tabbrowser]',
aTabBrowserChild,
XPathResult.FIRST_ORDERED_NODE_TYPE
null,
XPathResult.FIRST_ORDERED_NODE_TYPE,
null
).singleNodeValue;
return (b && b.tabbrowser) || b;
},
@ -166,17 +168,17 @@
return true;
},
getSelectedTabs : function TDU_getSelectedTabs(aEvent)
getSelectedTabs : function TDU_getSelectedTabs(aEventOrTabBrowser)
{
var b = this.getTabBrowserFromChild(aEvent.target);
var event = aEventOrTabBrowser instanceof Components.interfaces.nsIDOMEvent ? aEventOrTabBrowser : null ;
var b = this.getTabBrowserFromChild(event ? event.target : aEventOrTabBrowser );
var w = b.ownerDocument.defaultView;
var isMultipleDragEvent = this.isTabsDragging(aEvent);
var selectedTabs;
var isMultipleDrag = (
(
isMultipleDragEvent &&
(selectedTabs = this.getDraggedTabs(aEvent)) &&
this.isTabsDragging(event) &&
(selectedTabs = this.getDraggedTabs(event)) &&
selectedTabs.length
) ||
( // Firefox 4.x (https://bugzilla.mozilla.org/show_bug.cgi?id=566510)

View File

@ -3671,13 +3671,15 @@ TreeStyleTabBrowser.prototype = {
var targetBrowser = this.mTabBrowser;
var tabs = this.getTabsArray(targetBrowser);
var draggedTabs = [aTab];
var draggedRoots = [aTab];
var sourceWindow = aTab.ownerDocument.defaultView;
var sourceBrowser = this.getTabBrowserFromChild(aTab);
var draggedTabs = window['piro.sakura.ne.jp'].tabsDragUtils.getSelectedTabs(aInfo.event);
var draggedTabs = window['piro.sakura.ne.jp'].tabsDragUtils.getSelectedTabs(aInfo.event || sourceBrowser);
var draggedRoots = [aTab];
var isMultipleMove = false;
if (draggedTabs.length > 1) {
isMultipleMove = true;
if (!(aInfo.action & this.kACTIONS_FOR_DESTINATION)) {
draggedRoots = [];
draggedTabs.forEach(function(aTab) {
@ -3695,7 +3697,7 @@ TreeStyleTabBrowser.prototype = {
}
}
else if (aInfo.action & this.kACTIONS_FOR_DESTINATION) {
draggedTabs = draggedTabs.concat(sourceBrowser.treeStyleTab.getDescendantTabs(aTab));
draggedTabs = [aTab].concat(sourceBrowser.treeStyleTab.getDescendantTabs(aTab));
}
return {