diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-09-04 13:55:49 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-09-04 14:11:40 +0200 |
commit | 4af5a8c483278eae2e8e38f5ea0a238072848b87 (patch) | |
tree | beca3f5250e1a50eca58fa63eea056b69ab82e44 /apps/files_sharing/js | |
parent | 7c9d9992432839f2265b8f6b0f43ed15bfca9ff1 (diff) | |
parent | 09187f3b3b30e6f810c6afff7332615ed472154e (diff) | |
download | nextcloud-server-4af5a8c483278eae2e8e38f5ea0a238072848b87.tar.gz nextcloud-server-4af5a8c483278eae2e8e38f5ea0a238072848b87.zip |
Merge branch 'master' into fix_3728_with_file_exists_dialog
Conflicts:
apps/files/ajax/upload.php
apps/files/js/file-upload.js
apps/files/js/filelist.js
apps/files/js/files.js
apps/files/templates/part.list.php
Diffstat (limited to 'apps/files_sharing/js')
-rw-r--r-- | apps/files_sharing/js/public.js | 8 | ||||
-rw-r--r-- | apps/files_sharing/js/share.js | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/apps/files_sharing/js/public.js b/apps/files_sharing/js/public.js index a20b4ae636f..ac121fd08e2 100644 --- a/apps/files_sharing/js/public.js +++ b/apps/files_sharing/js/public.js @@ -16,7 +16,7 @@ $(document).ready(function() { if (typeof FileActions !== 'undefined') { var mimetype = $('#mimetype').val(); // Show file preview if previewer is available, images are already handled by the template - if (mimetype.substr(0, mimetype.indexOf('/')) != 'image') { + 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') { @@ -31,19 +31,19 @@ $(document).ready(function() { } } FileActions.register('dir', 'Open', OC.PERMISSION_READ, '', function(filename) { - var tr = $('tr').filterAttr('data-file', filename) + var tr = $('tr').filterAttr('data-file', filename); if (tr.length > 0) { window.location = $(tr).find('a.name').attr('href'); } }); FileActions.register('file', 'Download', OC.PERMISSION_READ, '', function(filename) { - var tr = $('tr').filterAttr('data-file', filename) + var tr = $('tr').filterAttr('data-file', filename); if (tr.length > 0) { window.location = $(tr).find('a.name').attr('href'); } }); FileActions.register('dir', 'Download', OC.PERMISSION_READ, '', function(filename) { - var tr = $('tr').filterAttr('data-file', filename) + var tr = $('tr').filterAttr('data-file', filename); if (tr.length > 0) { window.location = $(tr).find('a.name').attr('href')+'&download'; } diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index eb5a6e8cb7f..3be89a39fa0 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -4,6 +4,10 @@ $(document).ready(function() { if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !disableSharing) { + $('#fileList').one('fileActionsReady',function(){ + OC.Share.loadIcons('file'); + }); + FileActions.register('all', 'Share', OC.PERMISSION_READ, OC.imagePath('core', 'actions/share'), function(filename) { if ($('#dir').val() == '/') { var item = $('#dir').val() + filename; @@ -33,6 +37,5 @@ $(document).ready(function() { OC.Share.showDropDown(itemType, $(tr).data('id'), appendTo, true, possiblePermissions); } }); - OC.Share.loadIcons('file'); } }); |