Skip to content

Commit c2d67ff

Browse files
committed
Added option "prependFiles" to prepend files instead of appending them to the files container. Closes blueimp#1199.
1 parent 4b7fb8a commit c2d67ff

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

js/jquery.fileupload-ui.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* jQuery File Upload User Interface Plugin 6.6.4
2+
* jQuery File Upload User Interface Plugin 6.6.5
33
* https://github.com/blueimp/jQuery-File-Upload
44
*
55
* Copyright 2010, Sebastian Tschan
@@ -70,6 +70,12 @@
7070
uploadTemplateId: 'template-upload',
7171
// The ID of the download template:
7272
downloadTemplateId: 'template-download',
73+
// The container for the list of files. If undefined, it is set to
74+
// an element with class "files" inside of the widget element:
75+
filesContainer: undefined,
76+
// By default, files are appended to the files container.
77+
// Set the following option to true, to prepend files instead:
78+
prependFiles: false,
7379
// The expected data type of the upload response, sets the dataType
7480
// option of the $.ajax upload requests:
7581
dataType: 'json',
@@ -85,9 +91,10 @@
8591
that._adjustMaxNumberOfFiles(-files.length);
8692
data.isAdjusted = true;
8793
data.files.valid = data.isValidated = that._validate(files);
88-
data.context = that._renderUpload(files)
89-
.appendTo(options.filesContainer)
90-
.data('data', data);
94+
data.context = that._renderUpload(files).data('data', data);
95+
options.filesContainer[
96+
options.prependFiles ? 'prepend' : 'append'
97+
](data.context);
9198
that._renderPreviews(files, data.context);
9299
that._forceReflow(data.context);
93100
that._transition(data.context).done(

0 commit comments

Comments
 (0)