If selected egwActionObject(s) contain data, use that over global data store.

This commit is contained in:
Nathan Gray 2014-07-14 20:29:42 +00:00
parent 2461660920
commit 9f9f5184fc

View File

@ -157,10 +157,10 @@ function egwDragActionImplementation()
// Set file data // Set file data
for(var i = 0; i < selected.length; i++) for(var i = 0; i < selected.length; i++)
{ {
var data = egw.dataGetUIDdata(selected[i].id); var data = selected[i].data || egw.dataGetUIDdata(selected[i].id).data || {};
if(data && data.data.mime && data.data.download_url) if(data && data.mime && data.download_url)
{ {
var url = data.data.download_url; var url = data.download_url;
// NEED an absolute URL // NEED an absolute URL
if (url[0] == '/') url = egw.link(url); if (url[0] == '/') url = egw.link(url);
@ -170,7 +170,7 @@ function egwDragActionImplementation()
// Unfortunately, dragging files is currently only supported by Chrome // Unfortunately, dragging files is currently only supported by Chrome
if(navigator && navigator.userAgent.indexOf('Chrome')) if(navigator && navigator.userAgent.indexOf('Chrome'))
{ {
event.dataTransfer.setData("DownloadURL", data.data.mime+':'+data.data.name+':'+url); event.dataTransfer.setData("DownloadURL", data.mime+':'+data.name+':'+url);
} }
else else
{ {