From 5e5ec5a66a64d43ef5ea14c03b32055863f11bf1 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 29 Jul 2016 11:30:33 +0200 Subject: catch all input fields (in preparation for acl in this place) and display the files to upload in the right order --- view/js/mod_cloud.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'view/js') diff --git a/view/js/mod_cloud.js b/view/js/mod_cloud.js index 0c3bfe120..e56ec2a81 100644 --- a/view/js/mod_cloud.js +++ b/view/js/mod_cloud.js @@ -74,8 +74,6 @@ function UploadFileSelectHandler(e) { var files = e.target.files; } - - // process all File objects for (var i = 0, f; f = files[i]; i++) { if(e.target.id === 'files-upload') @@ -87,7 +85,8 @@ function UploadFileSelectHandler(e) { } function prepareHtml(f, i) { - $("#cloud-index tr:nth-child(2)").after( + var num = i - 1; + $('#cloud-index #new-upload-progress-bar-' + num.toString()).after( '' + '' + '' + f.name + '' + @@ -205,8 +204,12 @@ function UploadFile(file, idx) { // POST to the entire cloud path xhr.open('post', window.location.pathname, true); + var formfields = $("#ajax-upload-files").serializeArray(); + var data = new FormData(); - data.append('sabreAction', 'put'); + $.each(formfields, function(i, field) { + data.append(field.name, field.value); + }); data.append('file', file); xhr.send(data); -- cgit v1.2.3