made it to prepareHtml

This commit is contained in:
zotlabs 2017-11-30 16:24:18 -08:00
parent cce2b08e6b
commit cc0d53e695
2 changed files with 6 additions and 4 deletions

View File

@ -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(
'<tr id="new-upload-' + i + '" class="new-upload">' +
'<td><i class="fa ' + getIconFromType(f.type) + '" title="' + f.type + '"></i></td>' +

View File

@ -52,7 +52,7 @@
<td class="d-none d-md-table-cell"></td>
</tr>
{{/if}}
<tr id="new-upload-progress-bar--1"></tr> {{* this is needed to append the upload files in the right order *}}
<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>