From 86d59ed3063ce7ea3e877700522d2ad862e174e9 Mon Sep 17 00:00:00 2001 From: Piro / SHIMODA Hiroshi Date: Wed, 27 Apr 2011 02:44:19 +0900 Subject: [PATCH] don't drag whole tree if there is any selection --- content/treestyletab/bookmarksOverlay.js | 13 ++++++------- modules/tabbarDNDObserver.js | 24 +++++------------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/content/treestyletab/bookmarksOverlay.js b/content/treestyletab/bookmarksOverlay.js index 60abdf4c..e5cfefd7 100644 --- a/content/treestyletab/bookmarksOverlay.js +++ b/content/treestyletab/bookmarksOverlay.js @@ -405,15 +405,14 @@ var TreeStyleTabBookmarksService = { _onTabsDrop : function TSTBMService_onTabsDrop(aEvent) { - var groups = this.splitTabsToSubtrees(aEvent.tabs || []); + var tabs = aEvent.tabs || aEvent.getData('tabs') || []; + var groups = this.splitTabsToSubtrees(tabs); if ( groups.length == 1 && - ( - this.bookmarkDroppedTabsBehavior() != this.kBOOKMARK_DROPPED_TABS_ALL || - Array.some(aEvent.tabs, function(aTab) { - return aTab.getAttribute('multiselected') == 'true'; - }) - ) + this.bookmarkDroppedTabsBehavior() != this.kBOOKMARK_DROPPED_TABS_ALL && + !Array.some(tabs, function(aTab) { + return aTab.getAttribute('multiselected') == 'true'; + }) ) { aEvent.preventDefault(); aEvent.stopPropagation(); diff --git a/modules/tabbarDNDObserver.js b/modules/tabbarDNDObserver.js index a8ffd4f4..22329b50 100644 --- a/modules/tabbarDNDObserver.js +++ b/modules/tabbarDNDObserver.js @@ -735,27 +735,13 @@ catch(e) { event : aEvent }; var tabsInfo = this.getDraggedTabsInfoFromOneTab(actionInfo, aTab); - if (tabsInfo.draggedTabs.length <= 1) - return; - -/* if ( - 'MultipleTabService' in w && - 'isSelected' in w.MultipleTabService && - 'getSelectedTabs' in w.MultipleTabService && - 'clearSelection' in w.MultipleTabService && - 'setSelection' in w.MultipleTabService && - ( - !w.MultipleTabService.isSelected(aTab) || - w.MultipleTabService.getSelectedTabs(sv.browser) == [aTab] + tabsInfo.draggedTabs.length <= 1 || + Array.some(tabsInfo.draggedTabs, function(aTab) { + return aTab.getAttribute('multiselected') == 'true'; + }) ) - ) { - w.MultipleTabService.clearSelection(sv.browser); - tabsInfo.draggedTabs.forEach(function(aTab) { - w.MultipleTabService.setSelection(aTab, true); - }); - } -*/ + return; w['piro.sakura.ne.jp'].tabsDragUtils.startTabsDrag(aEvent, tabsInfo.draggedTabs); },