From 6b034ad2f9ef2d5443cc9b1b02b19ba20a11f37f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 20 Jul 2011 15:50:42 +0200 Subject: Allow users to start a new upload before the current upload has finished --- files/js/files.js | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) (limited to 'files/js/files.js') diff --git a/files/js/files.js b/files/js/files.js index af0c344f18d..d4191215972 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -143,21 +143,26 @@ $(document).ready(function() { return false; }); - $('#file_upload_start').change(function(){ - var files=$('#file_upload_start')[0].files; - $('#file_upload_target').load(function(){ - var response=jQuery.parseJSON($('#file_upload_target').contents().find('body').text()); + $('.file_upload_start').live('change',function(){ + var form=$(this).parent().parent(); + var uploadId=form.attr('data-upload-id'); + var files=this.files; + var target=form.children('iframe'); + target.load(function(){ + var response=jQuery.parseJSON(target.contents().find('body').text()); //set mimetype and if needed filesize - for(var i=0;i