diff options
author | Vincent Petry <pvince81@owncloud.com> | 2013-10-11 17:06:01 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2013-10-11 17:07:48 +0200 |
commit | e98ea06890e87a67f2ae501b7daa55882d1d3a03 (patch) | |
tree | 0e2f1162b3d9162000eba11f40808eedcc585fd7 | |
parent | 034968c61243e8335a5e83c4395ec10a094fd764 (diff) | |
download | nextcloud-server-e98ea06890e87a67f2ae501b7daa55882d1d3a03.tar.gz nextcloud-server-e98ea06890e87a67f2ae501b7daa55882d1d3a03.zip |
File actions are now updated after create/upload file
The file actions must explicitly be updated by calling
FileActions.display() on the file element after creating or uploading a
file.
Fixes #4971 and #4993
-rw-r--r-- | apps/files/js/file-upload.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index f1ef485fc3d..fbb53b3530a 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -523,8 +523,10 @@ $(document).ready(function() { function(result){ if (result.status == 'success') { var date=new Date(); - FileList.addFile(name,0,date,false,hidden); - var tr=$('tr').filterAttr('data-file',name); + // TODO: ideally addFile should be able to receive + // all attributes and set them automatically, + // and also auto-load the preview + var tr = FileList.addFile(name,0,date,false,hidden); tr.attr('data-size',result.data.size); tr.attr('data-mime',result.data.mime); tr.attr('data-id', result.data.id); @@ -533,6 +535,7 @@ $(document).ready(function() { lazyLoadPreview(path, result.data.mime, function(previewpath){ tr.find('td.filename').attr('style','background-image:url('+previewpath+')'); }); + FileActions.display(tr.find('td.filename')); } else { OC.dialogs.alert(result.data.message, t('core', 'Error')); } |