From cc0d53e6959f333d26003af64439b2fd8a8d665c Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 30 Nov 2017 16:24:18 -0800 Subject: made it to prepareHtml --- view/js/mod_cloud.js | 8 +++++--- view/tpl/cloud_directory.tpl | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/view/js/mod_cloud.js b/view/js/mod_cloud.js index 2215a9df9..0756c34e3 100644 --- a/view/js/mod_cloud.js +++ b/view/js/mod_cloud.js @@ -16,7 +16,7 @@ function UploadInit() { var fileselect = $("#files-upload"); var filedrag = $("#cloud-drag-area"); var submit = $("#upload-submit"); - + var count = 1; $('#invisible-cloud-file-upload').fileupload({ url: 'file_upload', @@ -26,6 +26,7 @@ function UploadInit() { maxChunkSize: 100000, // 4 * 1024 * 1024, add: function(e,data) { + $(data.files).each( function() { this.count = ++ count; prepareHtml(this) }); data.submit(); }, @@ -117,8 +118,9 @@ function UploadFileSelectHandler(e) { } } -function prepareHtml(f, i) { - var num = i - 1; +function prepareHtml(f) { + var num = f.count - 1; + var i = f.count; $('#cloud-index #new-upload-progress-bar-' + num.toString()).after( '' + '' + diff --git a/view/tpl/cloud_directory.tpl b/view/tpl/cloud_directory.tpl index 88b6bf563..7017df344 100644 --- a/view/tpl/cloud_directory.tpl +++ b/view/tpl/cloud_directory.tpl @@ -52,7 +52,7 @@ {{/if}} - {{* this is needed to append the upload files in the right order *}} + {{* this is needed to append the upload files in the right order *}} {{foreach $entries as $item}} -- cgit v1.2.3