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 id17418
push userdgottwald@mozilla.com
push dateTue, 07 Dec 2010 13:09:12 +0000
treeherdermozilla-central@6c2e0020c898 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersenn
bugs615515
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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"))