diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2020-04-11 09:23:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-11 09:23:11 +0300 |
commit | e5ac5c7f34a6551f0880f05cba7f7b9c871d0b0e (patch) | |
tree | 3729e1e98b11694f385ac4ee3a7c7f523eccce04 /apps/files_sharing/js | |
parent | b5a30d5cd6b53831c0d6d2fd074dc0000fa811de (diff) | |
parent | 43f0d2a3b5bc76ed72693695451398b4b7b78411 (diff) |
Merge pull request #20185 from azul/open-new_tab
Modify do_action so default ctrl-click opens tab
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r-- | apps/files_sharing/js/public.js | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 042cc6c056e..982f32dbdd9 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -113,9 +113,9 @@ OCA.Sharing.PublicApp = { // Show file preview if previewer is available, images are already handled by the template if (mimetype.substr(0, mimetype.indexOf('/')) !== 'image' && $('.publicpreview').length === 0) { // Trigger default action if not download TODO - var action = FileActions.getDefault(mimetype, 'file', OC.PERMISSION_READ); - if (typeof action !== 'undefined') { - action($('#filename').val()); + var spec = FileActions.getDefaultFileAction(mimetype, 'file', OC.PERMISSION_READ); + if (spec && spec.action) { + spec.action($('#filename').val()); } } } @@ -204,10 +204,6 @@ OCA.Sharing.PublicApp = { var $tr = OCA.Files.FileList.prototype._createRow.apply(this, arguments); if (hideDownload === 'true') { this.fileActions.currentFile = $tr.find('td'); - var mime = this.fileActions.getCurrentMimeType(); - var type = this.fileActions.getCurrentType(); - var permissions = this.fileActions.getCurrentPermissions(); - var action = this.fileActions.getDefault(mime, type, permissions); // Remove the link. This means that files without a default action fail hard $tr.find('a.name').attr('href', '#'); @@ -252,7 +248,7 @@ OCA.Sharing.PublicApp = { }; this.fileList.linkTo = function (dir) { - return OC.generateUrl('/s/' + token + '', {dir: dir}); + return OC.generateUrl('/s/' + token + '') + '?' + OC.buildQueryString({path: dir}); }; this.fileList.generatePreviewUrl = function (urlSpec) { |