Skip to content

Commit

Permalink
Render existing files by calling the done callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
blueimp committed Feb 9, 2012
1 parent 02c8595 commit ae7b1dd
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* jQuery File Upload Plugin JS Example 6.2
* jQuery File Upload Plugin JS Example 6.3
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
Expand Down Expand Up @@ -38,16 +38,11 @@ $(function () {
}
} else {
// Load existing files:
$.getJSON($('#fileupload').prop('action'), function (files) {
var fu = $('#fileupload').data('fileupload'),
template;
fu._adjustMaxNumberOfFiles(-files.length);
template = fu._renderDownload(files)
.appendTo($('#fileupload .files'));
// Force reflow:
fu._reflow = $.support.transition && template.length &&
template[0].offsetWidth;
template.addClass('in');
$.getJSON($('#fileupload').prop('action'), function (result) {
if (result && result.length) {
$('#fileupload').fileupload('option', 'done')
.call($('#fileupload')[0], null, {result: result});
}
});
}

Expand Down

0 comments on commit ae7b1dd

Please sign in to comment.