From 6fd5e50d60df716b31c3a9f696cded0e5d76f2ad Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 17 Sep 2013 15:34:39 +0000 Subject: [PATCH] Use a two step process to force an absolute URL, in case server settings have full URL --- phpgwapi/js/egw_action/egw_action_dragdrop.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpgwapi/js/egw_action/egw_action_dragdrop.js b/phpgwapi/js/egw_action/egw_action_dragdrop.js index 79b8a318a3..a150db1064 100644 --- a/phpgwapi/js/egw_action/egw_action_dragdrop.js +++ b/phpgwapi/js/egw_action/egw_action_dragdrop.js @@ -153,7 +153,12 @@ function egwDragActionImplementation() if(data && data.data.mime && data.data.download_url) { var url = data.data.download_url; - if (url[0] == '/') url = window.location.origin+egw.link(url); + + // NEED an absolute URL + if (url[0] == '/') url = egw.link(url); + // egw.link adds the webserver, but that might not be an absolute URL - try again + if (url[0] == '/') url = window.location.origin+url; + // Unfortunately, dragging files is currently only supported by Chrome if(navigator && navigator.userAgent.indexOf('Chrome')) {