Bug 615515 - Set the whole item as the dragged element. r=enn
authorDão Gottwald <dao@mozilla.com>
Tue, 07 Dec 2010 12:59:15 +0100
changeset 58769 23aa5649204e52380945e9761843751a092cd2dd
parent 58768 a8c06e21635d5d58d147bb23a971639e7e655dce
child 58770 bb42121e854a0f613c1cd91cc72ffeb18aa18bbf
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersenn
bugs615515
milestone2.0b8pre
Bug 615515 - Set the whole item as the dragged element. r=enn
browser/base/content/browser.js
toolkit/mozapps/downloads/content/downloads.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -7300,17 +7300,17 @@ var gIdentityHandler = {
     var urlString = value + "\n" + content.document.title;
     var htmlString = "<a href=\"" + value + "\">" + value + "</a>";
 
     var dt = event.dataTransfer;
     dt.setData("text/x-moz-url", urlString);
     dt.setData("text/uri-list", value);
     dt.setData("text/plain", value);
     dt.setData("text/html", htmlString);
-    dt.setDragImage(event.currentTarget, 0, 0);
+    dt.addElement(event.currentTarget);
   }
 };
 
 let DownloadMonitorPanel = {
   //////////////////////////////////////////////////////////////////////////////
   //// DownloadMonitorPanel Member Variables
 
   _panel: null,
--- a/toolkit/mozapps/downloads/content/downloads.js
+++ b/toolkit/mozapps/downloads/content/downloads.js
@@ -715,16 +715,17 @@ var gDownloadDNDObserver =
     var dl = gDownloadsView.selectedItem;
     var f = getLocalFileFromNativePathOrUrl(dl.getAttribute("file"));
     if (!f.exists())
       return;
 
     var dt = aEvent.dataTransfer;
     dt.mozSetDataAt("application/x-moz-file", f, 0);
     dt.effectAllowed = "copyMove";
+    dt.addElement(dl);
   },
 
   onDragOver: function (aEvent)
   {
     var types = aEvent.dataTransfer.types;
     if (types.contains("text/uri-list") ||
         types.contains("text/x-moz-url") ||
         types.contains("text/plain"))