aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/file-upload.js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-30 22:11:19 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-30 22:11:19 +0100
commit261cd87efa5623b51bbfa466f94d243bb7b49336 (patch)
tree25dd1d72e0a1e7563dc4bb6deabc937afd7946ec /apps/files/js/file-upload.js
parent0e92a4896df11d6fd3ee4ed73dfa1cb121d66895 (diff)
parentc1730d241c52b5e5c1719b6086d05cb30783e665 (diff)
downloadnextcloud-server-261cd87efa5623b51bbfa466f94d243bb7b49336.tar.gz
nextcloud-server-261cd87efa5623b51bbfa466f94d243bb7b49336.zip
Merge branch 'master' into home-storage
Diffstat (limited to 'apps/files/js/file-upload.js')
-rw-r--r--apps/files/js/file-upload.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 5bf4f5c0981..8c56f1cb364 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -334,8 +334,13 @@ $(document).ready(function() {
var result=$.parseJSON(response);
delete data.jqXHR;
-
- if (typeof result[0] === 'undefined') {
+
+ if (result.status === 'error' && result.data && result.data.message){
+ data.textStatus = 'servererror';
+ data.errorThrown = result.data.message;
+ var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');
+ fu._trigger('fail', e, data);
+ } else if (typeof result[0] === 'undefined') {
data.textStatus = 'servererror';
data.errorThrown = t('files', 'Could not get result from server.');
var fu = $(this).data('blueimp-fileupload') || $(this).data('fileupload');
@@ -460,7 +465,11 @@ $(document).ready(function() {
crumb.text(text);
}
- $(document).click(function() {
+ $(document).click(function(ev) {
+ // do not close when clicking in the dropdown
+ if ($(ev.target).closest('#new').length){
+ return;
+ }
$('#new>ul').hide();
$('#new').removeClass('active');
if ($('#new .error').length > 0) {