1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

[file upload] modified fileupload-ui.js to show error msg in the upload popup

This commit is contained in:
llj
2013-11-27 11:02:18 +08:00
parent 44b656d05f
commit 3360cc6780
2 changed files with 14 additions and 4 deletions

View File

@@ -143,7 +143,10 @@
data.context.each(function (index) {
var file = ($.isArray(data.result) &&
data.result[index]) || {error: 'emptyResult'};
file.size = data.files[index].size;
if (file.error) {
file.error = data.result.error || 'emptyResult'; // for ie, browsers which use iframe
file.name = data.files[index].name;
that._adjustMaxNumberOfFiles(1);
}
that._transition($(this)).done(
@@ -183,7 +186,14 @@
data.context.each(function (index) {
if (data.errorThrown !== 'abort') {
var file = data.files[index];
file.error = file.error || data.errorThrown ||
var r_error;
if (data.jqXHR.responseText) {
r_error = $.parseJSON(data.jqXHR.responseText).error;
}
if (data.dataType == 'iframe json') { // for browsers which use iframe
data.errorThrown = '';
}
file.error = r_error || file.error || data.errorThrown ||
'can not connect the server';
that._transition($(this)).done(
function () {