Accept drop of non-tab objects onto the tab bar correctly

This commit is contained in:
Piro / YUKI Hiroshi 2012-10-14 03:47:34 +09:00
parent 9182259ab5
commit 5bd57741df

View File

@ -745,22 +745,24 @@ catch(e) {
if (tab && if (tab &&
sv.shouldTabAutoExpanded(tab) && sv.shouldTabAutoExpanded(tab) &&
tab.getAttribute(sv.kDROP_POSITION) == 'self') { tab.getAttribute(sv.kDROP_POSITION) == 'self') {
let draggedTab = sv.getTabById(aDragged); let draggedTab = aDragged && sv.getTabById(aDragged);
if (sv.getTreePref('autoExpand.intelligently')) { if (sv.getTreePref('autoExpand.intelligently')) {
sv.collapseExpandTreesIntelligentlyFor(tab); sv.collapseExpandTreesIntelligentlyFor(tab);
aSelf.updateDragData(draggedTab); if (draggedTab)
aSelf.updateDragData(draggedTab);
} }
else { else {
if (aSelf.mAutoExpandedTabs.indexOf(aTarget) < 0) if (aSelf.mAutoExpandedTabs.indexOf(aTarget) < 0)
aSelf.mAutoExpandedTabs.push(aTarget); aSelf.mAutoExpandedTabs.push(aTarget);
sv.collapseExpandSubtree(tab, false); sv.collapseExpandSubtree(tab, false);
aSelf.updateDragData(draggedTab); if (draggedTab)
aSelf.updateDragData(draggedTab);
} }
} }
}, },
sv.getTreePref('autoExpand.delay') sv.getTreePref('autoExpand.delay')
); );
}, 0, this, tab.getAttribute(sv.kID), draggedTab.getAttribute(sv.kID)); }, 0, this, tab.getAttribute(sv.kID), draggedTab && draggedTab.getAttribute(sv.kID));
tab = null; tab = null;
}, },