Bug 320638 - Allow dropping links in-between tabs. r=gavin

This commit is contained in:
Dão Gottwald 2010-09-02 22:08:05 +02:00
parent 37b1df3df1
commit 3f66576697

View File

@ -2773,7 +2773,16 @@
<method name="_getDragTargetTab">
<parameter name="event"/>
<body><![CDATA[
return event.target.localName == "tab" ? event.target : null;
let tab = event.target.localName == "tab" ? event.target : null;
if (tab &&
(event.type == "drop" || event.type == "dragover") &&
event.dataTransfer.dropEffect == "link") {
let boxObject = tab.boxObject;
if (event.screenX < boxObject.screenX + boxObject.width * .25 ||
event.screenX > boxObject.screenX + boxObject.width * .75)
return null;
}
return tab;
]]></body>
</method>
@ -3022,6 +3031,7 @@
this._dragTime = Date.now();
if (Date.now() >= this._dragTime + this._dragOverDelay)
this.selectedItem = tab;
ind.collapsed = true;
return;
}
}