diff options
author | Brice Maron <brice@bmaron.net> | 2011-10-17 20:39:01 +0200 |
---|---|---|
committer | Brice Maron <brice@bmaron.net> | 2011-10-17 20:39:01 +0200 |
commit | 3c5a6a356a6d07df4111444620b578f22951f939 (patch) | |
tree | abbad6bede13c8be0813d4ad9b06c539daf89ddf /files/js | |
parent | 492931562fda62b1495af197b10e39f6c89a9949 (diff) | |
download | nextcloud-server-3c5a6a356a6d07df4111444620b578f22951f939.tar.gz nextcloud-server-3c5a6a356a6d07df4111444620b578f22951f939.zip |
Use notification to inform about errors in file list.
Diffstat (limited to 'files/js')
-rw-r--r-- | files/js/filelist.js | 17 | ||||
-rw-r--r-- | files/js/files.js | 20 |
2 files changed, 25 insertions, 12 deletions
diff --git a/files/js/filelist.js b/files/js/filelist.js index e6da922700d..3e85a35f6ef 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -173,6 +173,7 @@ FileList={ FileList.deleteCanceled=false; FileList.deleteFiles=files; $('#notification').text(t('files','undo deletion')); + $('#notification').data('deletefile',true); $('#notification').fadeIn(); }, finishDelete:function(ready,sync){ @@ -204,14 +205,18 @@ FileList={ $(document).ready(function(){ $('#notification').hide(); $('#notification').click(function(){ - FileList.deleteCanceled=true; - $('#notification').fadeOut(); - $.each(FileList.deleteFiles,function(index,file){ - $('tr[data-file="'+file+'"]').show(); + if($('#notification').data('deletefile')) + { + $.each(FileList.deleteFiles,function(index,file){ + $('tr[data-file="'+file+'"]').show(); // alert(file); - }); - FileList.deleteFiles=null; + }); + FileList.deleteCanceled=true; + FileList.deleteFiles=null; + } + $('#notification').fadeOut(); }); + $(window).bind('beforeunload', function (){ FileList.finishDelete(null,true); }); diff --git a/files/js/files.js b/files/js/files.js index 079646070d4..902c5e54934 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -182,13 +182,21 @@ $(document).ready(function() { var response=jQuery.parseJSON(target.contents().find('body').text()); //set mimetype and if needed filesize if(response){ - for(var i=0;i<response.length;i++){ - var file=response[i]; - $('tr[data-file="'+file.name+'"]').data('mime',file.mime); - if(size=='Pending'){ - $('tr[data-file='+file.name+'] td.filesize').text(file.size); + if(response[0] != undefined && response[0].status == 'success'){ + for(var i=0;i<response.length;i++){ + var file=response[i]; + $('tr[data-file="'+file.name+'"]').data('mime',file.mime); + if(size=='Pending'){ + $('tr[data-file='+file.name+'] td.filesize').text(file.size); + } + FileList.loadingDone(file.name); } - FileList.loadingDone(file.name); + } + else{ + $('#notification').text(t('files',response.data.message)); + $('#notification').fadeIn(); + $('#fileList > tr').not('[data-mime]').fadeOut(); + $('#fileList > tr').not('[data-mime]').remove(); } } }); |