# HG changeset patch # User rougeronj # Date 1360850706 -3600 # Node ID ebcdf4ce2e48cbd178a6d72e57f644e8aaef0638 # Parent 361f862573141861421b8f2fc5584d04bf41917f add error message and set progress bar to 0% when the upload is canceled diff -r 361f86257314 -r ebcdf4ce2e48 src/ldt/ldt/static/ldt/js/jquery.chunked_uploads.js --- a/src/ldt/ldt/static/ldt/js/jquery.chunked_uploads.js Thu Feb 14 12:37:22 2013 +0100 +++ b/src/ldt/ldt/static/ldt/js/jquery.chunked_uploads.js Thu Feb 14 15:05:06 2013 +0100 @@ -127,8 +127,6 @@ is_canceled = true; //stop the download chunked_uploads_jqXHR.abort(); - $('#pause_upload').attr('disabled', true); - $('#resume_upload').attr('disabled', true); //wait 1s before sending a DELETE request to the server setTimeout(function() { $.ajax({ @@ -140,7 +138,7 @@ $.ajax({ type: current_upload[0].delete_type, url: current_upload[0].delete_url, - data: authentication, + headers: authentication, }); } }); @@ -162,6 +160,16 @@ } }); } + $('#pause_upload').attr('disabled', true); + $('#resume_upload').attr('disabled', true); + $('#cancel_upload').attr('disabled', true); + $('.progress').css( + 'width', + 0 + '%' + ); + if (typeof chunked_uploads_error === "function") { + chunked_uploads_error(); + } }); $('#pause_upload').click(function (e) { @@ -225,5 +233,4 @@ } }); }; - }); \ No newline at end of file