This commit is contained in:
Winston Chang
2017-01-17 13:19:39 -05:00
parent 015bc98d60
commit 7f73a047a4
4 changed files with 22 additions and 10 deletions

View File

@@ -4818,6 +4818,24 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
};
this.onComplete = function () {
var self = this;
var fileInfo = $.map(this.files, function (file, i) {
return {
name: file.name,
size: file.size,
type: file.type
};
});
// Trigger shiny:inputchanged. Unlike a normal shiny:inputchanged event,
// it's not possible to modify the information before the values get
// sent to the server.
var evt = jQuery.Event("shiny:inputchanged");
evt.name = this.id;
evt.value = fileInfo;
evt.inputType = 'fileupload';
$(document).trigger(evt);
this.makeRequest('uploadEnd', [this.jobId, this.id], function (response) {
self.$setActive(false);
self.onProgress(null, 1);
@@ -4830,13 +4848,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
// Trigger event when all files are finished uploading.
var evt = jQuery.Event("shiny:fileuploaded");
evt.name = this.id;
evt.files = $.map(this.files, function (file, i) {
return {
name: file.name,
size: file.size,
type: file.type
};
});
evt.files = fileInfo;
$(document).trigger(evt);
};
this.onError = function (message) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long