diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-09-19 07:46:37 -0700 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2013-09-19 07:46:37 -0700 |
commit | bd5cb1d801a16933b7b75af5c514caec2afa5fef (patch) | |
tree | 8f687cdee3be9a2768025345ca16576d2cc67439 | |
parent | 9f9eb1b08f7b677e1b64af4d101d974b6bb326f8 (diff) | |
parent | 4344c62f7e09e44436e299652c00a495e48a5193 (diff) | |
download | nextcloud-server-bd5cb1d801a16933b7b75af5c514caec2afa5fef.tar.gz nextcloud-server-bd5cb1d801a16933b7b75af5c514caec2afa5fef.zip |
Merge pull request #4900 from owncloud/fixing-4488-master
File permissions are part of the ajax response of file upload
-rw-r--r-- | apps/files/ajax/upload.php | 3 | ||||
-rw-r--r-- | apps/files/js/fileactions.js | 5 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 7 |
3 files changed, 13 insertions, 2 deletions
diff --git a/apps/files/ajax/upload.php b/apps/files/ajax/upload.php index 1d03cd89f83..41d3a3eca4f 100644 --- a/apps/files/ajax/upload.php +++ b/apps/files/ajax/upload.php @@ -116,7 +116,8 @@ if (strpos($dir, '..') === false) { 'name' => basename($target), 'originalname' => $files['name'][$i], 'uploadMaxFilesize' => $maxUploadFileSize, - 'maxHumanFilesize' => $maxHumanFileSize + 'maxHumanFilesize' => $maxHumanFileSize, + 'permissions' => $meta['permissions'], ); } } diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 330fe86f6b3..009ea62de93 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -68,6 +68,9 @@ var FileActions = { if ($('tr[data-file="'+file+'"]').data('renaming')) { return; } + + // recreate fileactions + parent.children('a.name').find('.fileactions').remove(); parent.children('a.name').append('<span class="fileactions" />'); var defaultAction = FileActions.getDefault(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions()); @@ -117,6 +120,8 @@ var FileActions = { addAction('Share', actions.Share); } + // remove the existing delete action + parent.parent().children().last().find('.action.delete').remove(); if (actions['Delete']) { var img = FileActions.icons['Delete']; if (img.call) { diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 9a2d39c3652..fe706801b9e 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -130,7 +130,6 @@ var FileList={ if (hidden) { tr.hide(); } - FileActions.display(tr.find('td.filename')); return tr; }, addDir:function(name,size,lastModified,hidden){ @@ -776,6 +775,12 @@ $(document).ready(function(){ data.context.attr('data-size', file.size); data.context.find('td.filesize').text(humanFileSize(file.size)); } + var permissions = data.context.data('permissions'); + if(permissions != file.permissions) { + data.context.attr('data-permissions', file.permissions); + data.context.data('permissions', file.permissions); + } + FileActions.display(data.context.find('td.filename')); if (FileList.loadingDone) { FileList.loadingDone(file.name, file.id); } |