Merge pull request #4900 from owncloud/fixing-4488-master
File permissions are part of the ajax response of file upload
This commit is contained in:
commit
bd5cb1d801
3 changed files with 13 additions and 2 deletions
|
@ -116,7 +116,8 @@ if (strpos($dir, '..') === false) {
|
|||
'name' => basename($target),
|
||||
'originalname' => $files['name'][$i],
|
||||
'uploadMaxFilesize' => $maxUploadFileSize,
|
||||
'maxHumanFilesize' => $maxHumanFileSize
|
||||
'maxHumanFilesize' => $maxHumanFileSize,
|
||||
'permissions' => $meta['permissions'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue