Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Added a new getFilesFromResponse option method #2270

Merged
merged 1 commit into from
May 13, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions js/jquery.fileupload-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
done: function (e, data) {
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload'),
files = that._getFilesFromResponse(data),
files = that.options.getFilesFromResponse(data),
template,
deferred;
if (data.context) {
Expand Down Expand Up @@ -161,6 +161,13 @@
);
}
},
// Callback to retrieve the list of files from an upload
getFilesFromResponse: function (data) {
if (data.result && $.isArray(data.result.files)) {
return data.result.files;
}
return [];
},
// Callback for failed (abort or error) uploads:
fail: function (e, data) {
var that = $(this).data('blueimp-fileupload') ||
Expand Down Expand Up @@ -324,13 +331,6 @@
return this._finishedUploads;
},

_getFilesFromResponse: function (data) {
if (data.result && $.isArray(data.result.files)) {
return data.result.files;
}
return [];
},

// Link handler, that allows to download files
// by drag & drop of the links to the desktop:
_enableDragToDesktop: function () {
Expand Down