Skip to content

Commit

Permalink
add additional upload progress feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Stanford committed Apr 30, 2015
1 parent 03989cf commit de1a816
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions assets/multiupload.publish.js
Expand Up @@ -3,6 +3,7 @@
Symphony.Language.add({
'Drop files': false,
'In queue': false,
'Uploading': false,
'Remove file': false,
'Upload failed': false
});
Expand Down Expand Up @@ -119,10 +120,16 @@
},

// Upload progress
xhrFields: {
onprogress: function(progress) {
xhr: function() {
// get the native XmlHttpRequest object
var xhr = $.ajaxSettings.xhr();
// set the onprogress event handler
xhr.upload.onprogress = function(progress) {
item.find('.destructor').text(Symphony.Language.get('Uploading'));
item.find('.multiupload-progress').css('width', Math.floor(100 * progress.loaded / progress.total) + '%');
}
};
// return the customized object
return xhr;
}
});
};
Expand Down

0 comments on commit de1a816

Please sign in to comment.