From 7c6ed6ab33e8487d6de135b5e956a82685bf4463 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Tue, 8 Oct 2013 15:03:24 +0200 Subject: catch exceptions while uploading and pass on the error message --- apps/files/js/file-upload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/files/js/file-upload.js') diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index b52221ac1fc..88d5a05107f 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -365,7 +365,7 @@ $(document).ready(function() { } else if (result[0].status !== 'success') { //delete data.jqXHR; data.textStatus = 'servererror'; - data.errorThrown = result.data.message; // error message has been translated on server + data.errorThrown = result[0].data.message; // error message has been translated on server var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload'); fu._trigger('fail', e, data); } -- cgit v1.2.3 From e98ea06890e87a67f2ae501b7daa55882d1d3a03 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Fri, 11 Oct 2013 17:06:01 +0200 Subject: 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 --- apps/files/js/file-upload.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'apps/files/js/file-upload.js') 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')); } -- cgit v1.2.3