Wrong URL dragged from browser window on second drag when links are close together (72801) and link titles (and more) lost when dragging URLs to composition window (44371). r=kerz sr=alecf a=asa

This commit is contained in:
blakeross%telocity.com 2001-06-15 00:10:33 +00:00
Родитель 9f62bfa21b
Коммит 43fd5bde67
1 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -44,7 +44,7 @@ var contentAreaDNDObserver = {
var urlstring = null;
// htmlstring will be filled automatically if you fill urlstring
var htmlstring = null;
var isAnchor = false;
var domselection = aEvent.view.getSelection();
if (domselection && !domselection.isCollapsed &&
domselection.containsNode(draggedNode,false))
@ -53,9 +53,11 @@ var contentAreaDNDObserver = {
var firstAnchor = this.findFirstAnchor(domselection.anchorNode);
if (firstAnchor)
if (firstAnchor && domselection.containsNode(firstAnchor,false)) {
isAnchor = true;
urlstring = firstAnchor.href;
}
var privateSelection = domselection.QueryInterface(Components.interfaces.nsISelectionPrivate);
if (privateSelection)
{
@ -73,7 +75,6 @@ var contentAreaDNDObserver = {
if (aEvent.altKey && findParentNode(draggedNode, 'a'))
return false;
var isAnchor = false;
switch (draggedNode.localName.toUpperCase())
{
case 'AREA':
@ -138,7 +139,7 @@ var contentAreaDNDObserver = {
// if we haven't constructed a html version, make one now
if (!htmlstring && urlstring)
htmlstring = this.createLinkText(urlstring, urlstring);
htmlstring = this.createLinkText(urlstring, titlestring);
// now create the flavour lists
aXferData.data = new TransferData();