Clear dragging status correctly for cross-window tab drag and drop

This commit is contained in:
Piro / YUKI Hiroshi 2012-08-30 05:48:28 +09:00
parent 929dbce943
commit 267ab40a9b

View File

@ -879,7 +879,9 @@ try{
if (indicatorTab.getAttribute(sv.kDROP_POSITION) != dropPosition) { if (indicatorTab.getAttribute(sv.kDROP_POSITION) != dropPosition) {
this.clearDropPosition(); this.clearDropPosition();
indicatorTab.setAttribute(sv.kDROP_POSITION, dropPosition); indicatorTab.setAttribute(sv.kDROP_POSITION, dropPosition);
if ('_animateTabMove' in tabbar) { // Firefox 17 and later // Firefox 17 and later
if ('_animateTabMove' in tabbar &&
draggedTab.ownerDocument == b.ownerDocument) {
if (!tabbar.hasAttribute('movingtab')) if (!tabbar.hasAttribute('movingtab'))
tabbar.setAttribute('movingtab', 'true'); tabbar.setAttribute('movingtab', 'true');
if (dropPosition != 'self') if (dropPosition != 'self')
@ -926,7 +928,6 @@ catch(e) {
var dt = aEvent.dataTransfer; var dt = aEvent.dataTransfer;
this.clearDropPosition(true); this.clearDropPosition(true);
if (tabbar._tabDropIndicator) if (tabbar._tabDropIndicator)
tabbar._tabDropIndicator.collapsed = true; tabbar._tabDropIndicator.collapsed = true;
@ -942,6 +943,10 @@ catch(e) {
} }
} }
var sourceBrowser = sv.getTabBrowserFromChild(draggedTab);
if (draggedTab && sourceBrowser != b)
sourceBrowser.treeStyleTab.tabbarDNDObserver.clearDropPosition(true);
if (draggedTab && this.performDrop(dropActionInfo, draggedTab)) { if (draggedTab && this.performDrop(dropActionInfo, draggedTab)) {
aEvent.stopPropagation(); aEvent.stopPropagation();
return; return;
@ -952,7 +957,7 @@ catch(e) {
draggedTab && draggedTab &&
( (
dt.dropEffect == 'copy' || dt.dropEffect == 'copy' ||
sv.getTabBrowserFromChild(draggedTab) != b sourceBrowser != b
) && ) &&
dropActionInfo.position == sv.kDROP_ON dropActionInfo.position == sv.kDROP_ON
) { ) {