diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-02-24 23:12:14 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-02-24 23:54:38 +0100 |
commit | 66f4f06dd99906283e963cd7afa720f6ffe40220 (patch) | |
tree | e8301a4362774a5f1937b75be7538e449630faed /files | |
parent | 11cb45bd432b6b7521f43f53e91dbec1537193cd (diff) | |
download | nextcloud-server-66f4f06dd99906283e963cd7afa720f6ffe40220.tar.gz nextcloud-server-66f4f06dd99906283e963cd7afa720f6ffe40220.zip |
if a deleted file is uploaded, finish the delete first
otherwise the upload will fail because the file still exists on the server, the old file will be deleted and neither the old or new file will be left
Diffstat (limited to 'files')
-rw-r--r-- | files/js/files.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/files/js/files.js b/files/js/files.js index bebcf4e97a4..9f1f5368df0 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -166,6 +166,7 @@ $(document).ready(function() { $('.file_upload_start').live('change',function(){ var form=$(this).closest('form'); + var that=this; var uploadId=form.attr('data-upload-id'); var files=this.files; var target=form.children('iframe'); @@ -173,6 +174,12 @@ $(document).ready(function() { if(files){ for(var i=0;i<files.length;i++){ totalSize+=files[i].size; + if(FileList.deleteFiles && FileList.deleteFiles.indexOf(files[i].name)!=-1){//finish delete if we are uploading a deleted file + FileList.finishDelete(function(){ + $(that).change(); + }); + return; + } } } if(totalSize>$('#max_upload').val()){ |