don't drag whole tree if there is any selection

This commit is contained in:
Piro / SHIMODA Hiroshi 2011-04-27 02:44:19 +09:00
parent 148790e877
commit 86d59ed306
2 changed files with 11 additions and 26 deletions

View File

@ -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();

View File

@ -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);
},