diff options
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r-- | apps/files_sharing/js/public.js | 12 | ||||
-rw-r--r-- | apps/files_sharing/js/share.js | 6 |
2 files changed, 13 insertions, 5 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index 92b626bba18..b1b6b079db6 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -1,6 +1,10 @@ // Override download path to files_sharing/public.php function fileDownloadPath(dir, file) { - return $('#downloadURL').val(); + var url = $('#downloadURL').val(); + if (url.indexOf('&path=') != -1) { + url += '/'+file; + } + return url; } $(document).ready(function() { @@ -17,6 +21,12 @@ $(document).ready(function() { action($('#filename').val()); } } + FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function(filename) { + var tr = $('tr').filterAttr('data-file', filename) + if (tr.length > 0) { + window.location = $(tr).find('a.name').attr('href'); + } + }); } });
\ No newline at end of file diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 9d0e2c90f88..a171751589a 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -39,10 +39,8 @@ $(document).ready(function() { var tr = $('tr').filterAttr('data-file', filename); if ($(tr).data('type') == 'dir') { var itemType = 'folder'; - var link = false; } else { var itemType = 'file'; - var link = true; } var possiblePermissions = $(tr).data('permissions'); var appendTo = $(tr).find('td.filename'); @@ -51,14 +49,14 @@ $(document).ready(function() { if (item != $('#dropdown').data('item')) { OC.Share.hideDropDown(function () { $(tr).addClass('mouseOver'); - OC.Share.showDropDown(itemType, $(tr).data('id'), appendTo, link, possiblePermissions); + OC.Share.showDropDown(itemType, $(tr).data('id'), appendTo, true, possiblePermissions); }); } else { OC.Share.hideDropDown(); } } else { $(tr).addClass('mouseOver'); - OC.Share.showDropDown(itemType, $(tr).data('id'), appendTo, link, possiblePermissions); + OC.Share.showDropDown(itemType, $(tr).data('id'), appendTo, true, possiblePermissions); } }); } |