// show tab
this._fileListSelector.closest('.messageTabMenu').messageTabMenu('showTab', 'attachments', true);
+ var callbackUploadId = (function(uploadId) {
+ if (replace === null) {
+ this._autoInsert.push(uploadId);
+ }
+ else {
+ this._replaceOnLoad[uploadId] = replace;
+ }
+
+ data.uploadID = uploadId;
+ }).bind(this);
+
if (data.file) {
- $uploadID = this._upload(undefined, data.file);
+ $uploadID = this._upload(undefined, data.file, undefined, callbackUploadId);
}
else {
- $uploadID = this._upload(undefined, undefined, data.blob);
+ $uploadID = this._upload(undefined, undefined, data.blob, callbackUploadId);
replace = data.replace || null;
}
-
- if (replace === null) {
- this._autoInsert.push($uploadID);
- }
- else {
- this._replaceOnLoad[$uploadID] = replace;
- }
-
- data.uploadID = $uploadID;
},
/**
/**
* @see WCF.Upload._upload()
*/
- _upload: function (event, file, blob) {
+ _upload: function (event, file, blob, callbackUploadId) {
var _super = this._super.bind(this);
require([
this._createButton();
}
+ if (typeof callbackUploadId === 'function') {
+ callbackUploadId(uploadID);
+ }
+
return uploadID;
}).bind(this))
.catch(function (error) {