diff options
author | chirags@google.com <chirags@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-20 02:16:18 +0000 |
---|---|---|
committer | chirags@google.com <chirags@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-20 02:16:18 +0000 |
commit | 174cc2580a9e0a0bbccd35493889008d2a98dcd3 (patch) | |
tree | 4df05a7ebbaeeb80cdaf6306769fc5385be4898e /net/base/dir_header.html | |
parent | 4fa24bfa0b637b34d92432c98b318362b014c540 (diff) | |
download | chromium_src-174cc2580a9e0a0bbccd35493889008d2a98dcd3.zip chromium_src-174cc2580a9e0a0bbccd35493889008d2a98dcd3.tar.gz chromium_src-174cc2580a9e0a0bbccd35493889008d2a98dcd3.tar.bz2 |
[fix issue 27772]: Add support for drag/drop files from FTP.
http://code.google.com/p/chromium/issues/detail?id=27772
Review URL: http://codereview.chromium.org/7657017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97547 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base/dir_header.html')
-rw-r--r-- | net/base/dir_header.html | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/base/dir_header.html b/net/base/dir_header.html index 4f33bba..b281a98 100644 --- a/net/base/dir_header.html +++ b/net/base/dir_header.html @@ -31,6 +31,9 @@ function addRow(name, url, isdir, size, date_modified) { name = name + "/"; url = url + "/"; size = ""; + } else { + link.draggable = "true"; + link.addEventListener("dragstart", onDragStart, false); } link.innerText = name; link.href = root + url; @@ -44,6 +47,14 @@ function addRow(name, url, isdir, size, date_modified) { table.appendChild(row); } +function onDragStart(e) { + var el = e.srcElement; + var name = el.innerText.replace(":", ""); + var download_url_data = "application/octet-stream:" + name + ":" + el.href; + e.dataTransfer.setData("DownloadURL", download_url_data); + e.dataTransfer.effectAllowed = "copy"; +} + function createCell(text) { var cell = document.createElement("td"); cell.setAttribute("class", "detailsColumn"); |