diff options
Diffstat (limited to 'view')
-rw-r--r-- | view/js/mod_cloud.js | 11 | ||||
-rw-r--r-- | view/tpl/cloud_directory.tpl | 2 |
2 files changed, 9 insertions, 4 deletions
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( '<tr id="new-upload-' + i + '" class="new-upload">' + '<td><i class="fa ' + getIconFromType(f.type) + '" title="' + f.type + '"></i></td>' + '<td>' + f.name + '</td>' + @@ -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); diff --git a/view/tpl/cloud_directory.tpl b/view/tpl/cloud_directory.tpl index 06176fdb8..5a84028c1 100644 --- a/view/tpl/cloud_directory.tpl +++ b/view/tpl/cloud_directory.tpl @@ -18,6 +18,7 @@ <td class="hidden-xs"></td> </tr> {{/if}} + <tr id="new-upload-progress-bar--1"></tr> {{* this is needed to append the upload files in the right order *}} {{foreach $entries as $item}} <tr id="cloud-index-{{$item.attachId}}"> <td><i class="fa {{$item.iconFromType}}" title="{{$item.type}}"></i></td> @@ -38,6 +39,7 @@ <tr id="cloud-tools-{{$item.attachId}}"> <td id="perms-panel-{{$item.attachId}}" colspan="9"></td> </tr> + {{/foreach}} </table> </div> |