failed to tear off selected tabs if the multiple tab handler is installed

This commit is contained in:
Piro / SHIMODA Hiroshi 2011-02-09 03:13:04 +09:00
parent 6d13730c64
commit 68e4690da8
2 changed files with 10 additions and 7 deletions

View File

@ -13,7 +13,7 @@
http://github.com/piroor/fxaddonlibs/blob/master/tabsDragUtils.js http://github.com/piroor/fxaddonlibs/blob/master/tabsDragUtils.js
*/ */
(function() { (function() {
const currentRevision = 10; const currentRevision = 11;
if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {}; if (!('piro.sakura.ne.jp' in window)) window['piro.sakura.ne.jp'] = {};
@ -222,15 +222,18 @@
return true; return true;
}, },
getSelectedTabs : function TDU_getSelectedTabs(aEventOrTabBrowser) getSelectedTabs : function TDU_getSelectedTabs(aEventOrTabOrTabBrowser)
{ {
var event = aEventOrTabBrowser instanceof Components.interfaces.nsIDOMEvent ? aEventOrTabBrowser : null ; var event = aEventOrTabOrTabBrowser instanceof Components.interfaces.nsIDOMEvent ? aEventOrTabOrTabBrowser : null ;
var b = this.getTabBrowserFromChild(event ? event.target : aEventOrTabBrowser ); var b = this.getTabBrowserFromChild(event ? event.target : aEventOrTabOrTabBrowser );
if (!b) if (!b)
return []; return [];
var w = b.ownerDocument.defaultView; var w = b.ownerDocument.defaultView;
var tab = event && this.getTabFromEvent(event); var tab = (aEventOrTabOrTabBrowser instanceof Components.interfaces.nsIDOMElement &&
aEventOrTabOrTabBrowser.localName == 'tab') ?
aEventOrTabOrTabBrowser :
(event && this.getTabFromEvent(event)) ;
var selectedTabs; var selectedTabs;
var isMultipleDrag = ( var isMultipleDrag = (
@ -255,7 +258,7 @@
tab && tab &&
'MultipleTabService' in w && 'MultipleTabService' in w &&
w.MultipleTabService.isSelected(tab) && w.MultipleTabService.isSelected(tab) &&
MultipleTabService.allowMoveMultipleTabs && w.MultipleTabService.allowMoveMultipleTabs &&
(selectedTabs = w.MultipleTabService.getSelectedTabs(b)) && (selectedTabs = w.MultipleTabService.getSelectedTabs(b)) &&
selectedTabs.length selectedTabs.length
) )

View File

@ -543,7 +543,7 @@ catch(e) {
var sourceWindow = aTab.ownerDocument.defaultView; var sourceWindow = aTab.ownerDocument.defaultView;
var sourceBrowser = sv.getTabBrowserFromChild(aTab); var sourceBrowser = sv.getTabBrowserFromChild(aTab);
var draggedTabs = w['piro.sakura.ne.jp'].tabsDragUtils.getSelectedTabs(aInfo.event || sourceBrowser); var draggedTabs = w['piro.sakura.ne.jp'].tabsDragUtils.getSelectedTabs(aInfo.event || aTab || sourceBrowser);
var draggedRoots = [aTab]; var draggedRoots = [aTab];
var isMultipleMove = false; var isMultipleMove = false;