diff options
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r-- | apps/files_sharing/js/public.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 82691129926..16576651a25 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -148,11 +148,14 @@ OCA.Sharing.PublicApp = { if (this.fileList) { // TODO: move this to a separate PublicFileList class that extends OCA.Files.FileList (+ unit tests) - this.fileList.getDownloadUrl = function (filename, dir) { - if ($.isArray(filename)) { + this.fileList.getDownloadUrl = function (filename, dir, isDir) { + var path = dir || this.getCurrentDirectory(); + if (filename && !_.isArray(filename) && !isDir) { + return OC.getRootPath() + '/public.php/webdav' + OC.joinPaths(path, filename); + } + if (_.isArray(filename)) { filename = JSON.stringify(filename); } - var path = dir || FileList.getCurrentDirectory(); var params = { path: path, files: filename |